diff mbox

drm/i915/dp: use drm_edid_duplicate

Message ID 1380613134-16712-1-git-send-email-jani.nikula@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jani Nikula Oct. 1, 2013, 7:38 a.m. UTC
v2: duplicate intel_connector->edid, not uninitialized edid (Dave Airlie).

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c |   10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

Comments

Dave Airlie Oct. 9, 2013, 5:30 a.m. UTC | #1
On Tue, Oct 1, 2013 at 5:38 PM, Jani Nikula <jani.nikula@intel.com> wrote:
> v2: duplicate intel_connector->edid, not uninitialized edid (Dave Airlie).

Okay I merged this one,

Thanks,
Dave.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 5614365..6030394 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2969,19 +2969,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);