diff options
author | Thomas Meyer <thomas@m3y3r.de> | 2011-11-17 22:43:40 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-25 00:04:51 +0100 |
commit | 53090aada474fe10052602ca3f46701591b666a5 (patch) | |
tree | 15ea9665c41b0a10f1a636e9f37fbf94556ce67f | |
parent | [media] dib9090: limit the I2C speed (diff) | |
download | linux-53090aada474fe10052602ca3f46701591b666a5.tar.xz linux-53090aada474fe10052602ca3f46701591b666a5.zip |
[media] drxd: Use kmemdup rather than duplicating its implementation
The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup.cocci.
Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/frontends/drxd_hard.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/dvb/frontends/drxd_hard.c b/drivers/media/dvb/frontends/drxd_hard.c index 88e46f4cdbb2..beb67759f824 100644 --- a/drivers/media/dvb/frontends/drxd_hard.c +++ b/drivers/media/dvb/frontends/drxd_hard.c @@ -914,14 +914,13 @@ static int load_firmware(struct drxd_state *state, const char *fw_name) return -EIO; } - state->microcode = kmalloc(fw->size, GFP_KERNEL); + state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL); if (state->microcode == NULL) { release_firmware(fw); printk(KERN_ERR "drxd: firmware load failure: no memory\n"); return -ENOMEM; } - memcpy(state->microcode, fw->data, fw->size); state->microcode_length = fw->size; release_firmware(fw); return 0; |