From: Thomas Meyer Date: Wed, 22 May 2013 21:06:30 +0000 (+0000) Subject: drm: Cocci spatch "memdup.spatch" X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=8d06cd0af6c50a26d87ce78310ad38b9b40fa795;p=linux-beck.git drm: Cocci spatch "memdup.spatch" Signed-off-by: Thomas Meyer Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_edid_load.c b/drivers/gpu/drm/drm_edid_load.c index fa445dd4dc00..a4f5ce14dc1c 100644 --- a/drivers/gpu/drm/drm_edid_load.c +++ b/drivers/gpu/drm/drm_edid_load.c @@ -186,12 +186,11 @@ static u8 *edid_load(struct drm_connector *connector, char *name, goto relfw_out; } - edid = kmalloc(fwsize, GFP_KERNEL); + edid = kmemdup(fwdata, fwsize, GFP_KERNEL); if (edid == NULL) { err = -ENOMEM; goto relfw_out; } - memcpy(edid, fwdata, fwsize); if (!drm_edid_block_valid(edid, 0, print_bad_edid)) { connector->bad_edid_counter++;