[PATCH] drm/i915: Cocci spatch "memdup.spatch"

From: Thomas Meyer
Date: Wed May 22 2013 - 17:07:27 EST



Signed-off-by: Thomas Meyer <thomas@xxxxxxxx>
---

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;
}



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/