Commit 55e9edeb authored by Jani Nikula's avatar Jani Nikula Committed by Dave Airlie

drm/i915/dp: use drm_edid_duplicate

v2: duplicate intel_connector->edid, not uninitialized edid (Dave Airlie).
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 1eee814d
...@@ -2920,19 +2920,11 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter) ...@@ -2920,19 +2920,11 @@ intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
/* use cached edid if we have one */ /* use cached edid if we have one */
if (intel_connector->edid) { if (intel_connector->edid) {
struct edid *edid;
int size;
/* invalid edid */ /* invalid edid */
if (IS_ERR(intel_connector->edid)) if (IS_ERR(intel_connector->edid))
return NULL; return NULL;
size = (intel_connector->edid->extensions + 1) * EDID_LENGTH; return drm_edid_duplicate(intel_connector->edid);
edid = kmemdup(intel_connector->edid, size, GFP_KERNEL);
if (!edid)
return NULL;
return edid;
} }
return drm_get_edid(connector, adapter); return drm_get_edid(connector, adapter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment