diff mbox

drm/i915: Cocci spatch "memdup.spatch"

Message ID 1369256829.3865.435.camel@localhost.localdomain (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Meyer May 22, 2013, 9:07 p.m. UTC
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
---

Comments

Daniel Vetter May 23, 2013, 6:40 a.m. UTC | #1
On Wed, May 22, 2013 at 11:07:09PM +0200, Thomas Meyer wrote:
> 
> Signed-off-by: Thomas Meyer <thomas@m3y3r.de>

Queued for -next, thanks for the patch.
-Daniel
diff mbox

Patch

diff -u -p a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2282,11 +2282,10 @@  intel_dp_get_edid(struct drm_connector *
 			return NULL;
 
 		size = (intel_connector->edid->extensions + 1) * EDID_LENGTH;
-		edid = kmalloc(size, GFP_KERNEL);
+		edid = kmemdup(intel_connector->edid, size, GFP_KERNEL);
 		if (!edid)
 			return NULL;
 
-		memcpy(edid, intel_connector->edid, size);
 		return edid;
 	}