Commit bc6a5419 authored by Alexandru Gheorghiu's avatar Alexandru Gheorghiu Committed by Patrik Jakobsson

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: default avatarAlexandru Gheorghiu <gheorghiuandru@gmail.com>
Signed-off-by: default avatarPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
parent 72c0493c
...@@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private *dev_priv, ...@@ -218,12 +218,11 @@ static void parse_backlight_data(struct drm_psb_private *dev_priv,
bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT); bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type; 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) { if (!lvds_bl) {
dev_err(dev_priv->dev->dev, "out of memory for backlight data\n"); dev_err(dev_priv->dev->dev, "out of memory for backlight data\n");
return; return;
} }
memcpy(lvds_bl, vbt_lvds_bl, sizeof(*vbt_lvds_bl));
dev_priv->lvds_bl = lvds_bl; dev_priv->lvds_bl = lvds_bl;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment