]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
drm: Cocci spatch "memdup.spatch"
authorThomas Meyer <thomas@m3y3r.de>
Wed, 22 May 2013 21:06:30 +0000 (21:06 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 10 Jun 2013 22:29:22 +0000 (08:29 +1000)
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_edid_load.c

index fa445dd4dc006e5c1ec2f079b206cdd72cecf7e6..a4f5ce14dc1cdca1970a689ab19f6c10144aec8d 100644 (file)
@@ -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++;