summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Gheorghiu <gheorghiuandru@gmail.com>2013-03-11 21:46:14 +0200
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>2013-03-13 22:37:32 +0100
commitbc6a541941df6e05b0c53133537ce4cf31336c3f (patch)
tree701aaa1bfb41648faf86c70c1f3771dd3ca2587b
parent72c0493ceb88ec9774ee4fa3f37fd19096fb7870 (diff)
downloadlinux-3.10-bc6a541941df6e05b0c53133537ce4cf31336c3f.tar.gz
linux-3.10-bc6a541941df6e05b0c53133537ce4cf31336c3f.tar.bz2
linux-3.10-bc6a541941df6e05b0c53133537ce4cf31336c3f.zip
drivers: gpu: drm: gma500: Replaced calls kzalloc & memcpy with kmemdup
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>
-rw-r--r--drivers/gpu/drm/gma500/intel_bios.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/gpu/drm/gma500/intel_bios.c b/drivers/gpu/drm/gma500/intel_bios.c
index 403fffb03ab..d3497348c4d 100644
--- a/drivers/gpu/drm/gma500/intel_bios.c
+++ b/drivers/gpu/drm/gma500/intel_bios.c
@@ -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;
}