]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup
authorAlexandru Gheorghiu <gheorghiuandru@gmail.com>
Mon, 11 Mar 2013 19:46:14 +0000 (21:46 +0200)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 13 Mar 2013 21:37:32 +0000 (22:37 +0100)
Replaced calls kzalloc followed by memcpy with call to kmemdup.
Patch found using coccinelle.

Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drivers/gpu/drm/gma500/intel_bios.c

index 403fffb03abd5c7d9594a92c0569206ea5d4edb8..d3497348c4d5d81a240369d1d0dc831b30c29dbe 100644 (file)
@@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private *dev_priv,
        bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
        vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
 
-       lvds_bl = kzalloc(sizeof(*vbt_lvds_bl), GFP_KERNEL);
+       lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
        if (!lvds_bl) {
                dev_err(dev_priv->dev->dev, "out of memory for backlight data\n");
                return;
        }
-       memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
        dev_priv->lvds_bl = lvds_bl;
 }