diff options
author | cem <cem@FreeBSD.org> | 2016-04-20 03:48:57 +0000 |
---|---|---|
committer | cem <cem@FreeBSD.org> | 2016-04-20 03:48:57 +0000 |
commit | 32534f70cf45a9c425919195248f99080071d442 (patch) | |
tree | 2c196e9f708e5d75d8a1941f5ea5e823be5eed15 /sys/dev/drm2 | |
parent | 0016129945306b587790ae0451857a041f3814fc (diff) | |
download | FreeBSD-src-32534f70cf45a9c425919195248f99080071d442.zip FreeBSD-src-32534f70cf45a9c425919195248f99080071d442.tar.gz |
i915kms: Fix memory leak if a CRT is detected
Reported by: Coverity
CID: 1090729
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'sys/dev/drm2')
-rw-r--r-- | sys/dev/drm2/i915/intel_crt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/drm2/i915/intel_crt.c b/sys/dev/drm2/i915/intel_crt.c index e9ac349..56c2120 100644 --- a/sys/dev/drm2/i915/intel_crt.c +++ b/sys/dev/drm2/i915/intel_crt.c @@ -423,6 +423,7 @@ static bool intel_crt_detect_ddc(struct drm_connector *connector) 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 drm_connector *connector) */ 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_connector *connector) 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 |