drm/i915/dp: use drm_edid_duplicate

v2: duplicate intel_connector->edid, not uninitialized edid (Dave Airlie).

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Jani Nikula 2013-10-01 10:38:54 +03:00 committed by Dave Airlie
parent 1eee814dfd
commit 55e9edeb57

View File

@ -2920,19 +2920,11 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
/* use cached edid if we have one */
if (intel_connector->edid) {
struct edid *edid;
int size;
/* invalid edid */
if (IS_ERR(intel_connector->edid))
return NULL;
size = (intel_connector->edid->extensions + 1) * EDID_LENGTH;
edid = kmemdup(intel_connector->edid, size, GFP_KERNEL);
if (!edid)
return NULL;
return edid;
return drm_edid_duplicate(intel_connector->edid);
}
return drm_get_edid(connector, adapter);