Date: Wed, 20 Apr 2016 03:48:57 +0000 (UTC) From: "Conrad E. Meyer" <cem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298335 - head/sys/dev/drm2/i915 Message-ID: <201604200348.u3K3mv1B070909@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: cem Date: Wed Apr 20 03:48:57 2016 New Revision: 298335 URL: https://svnweb.freebsd.org/changeset/base/298335 Log: i915kms: Fix memory leak if a CRT is detected Reported by: Coverity CID: 1090729 Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/drm2/i915/intel_crt.c Modified: head/sys/dev/drm2/i915/intel_crt.c ============================================================================== --- head/sys/dev/drm2/i915/intel_crt.c Wed Apr 20 03:45:45 2016 (r298334) +++ head/sys/dev/drm2/i915/intel_crt.c Wed Apr 20 03:48:57 2016 (r298335) @@ -423,6 +423,7 @@ static bool intel_crt_detect_ddc(struct struct drm_i915_private *dev_priv = crt->base.base.dev->dev_private; struct edid *edid; device_t i2c; + bool res = false; BUG_ON(crt->base.type != INTEL_OUTPUT_ANALOG); @@ -439,7 +440,8 @@ static bool intel_crt_detect_ddc(struct */ if (!is_digital) { DRM_DEBUG_KMS("CRT detected via DDC:0x50 [EDID]\n"); - return true; + res = true; + goto out; } DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [EDID reports a digital panel]\n"); @@ -447,9 +449,10 @@ static bool intel_crt_detect_ddc(struct DRM_DEBUG_KMS("CRT not detected via DDC:0x50 [no valid EDID found]\n"); } +out: free(edid, DRM_MEM_KMS); - return false; + return res; } static enum drm_connector_status
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201604200348.u3K3mv1B070909>