i915kms: Fix memory leak if a CRT is detected

Reported by:	Coverity
CID:		1090729
Sponsored by:	EMC / Isilon Storage Division
This commit is contained in:
cem 2016-04-20 03:48:57 +00:00
parent 0016129945
commit 32534f70cf

View File

@ -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