summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Huewe <PeterHuewe@gmx.de>2013-01-25 19:23:30 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-02-06 09:05:07 -0200
commit42f9de6eab3892d7da544be1cc882530eab5b203 (patch)
treeca85fc060e4fae1e1d76657389aeafbf844c5ee0
parent0a147c3bf75d429fc7922abb582c7c686b028bc4 (diff)
downloadop-kernel-dev-42f9de6eab3892d7da544be1cc882530eab5b203.zip
op-kernel-dev-42f9de6eab3892d7da544be1cc882530eab5b203.tar.gz
[media] staging/media/go7007: Use kmemdup rather than duplicating its implementation
Found with coccicheck. The semantic patch that makes this change is available in scripts/coccinelle/api/memdup.cocci. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/staging/media/go7007/go7007-driver.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/media/go7007/go7007-driver.c b/drivers/staging/media/go7007/go7007-driver.c
index 0aaeb0a..6695091 100644
--- a/drivers/staging/media/go7007/go7007-driver.c
+++ b/drivers/staging/media/go7007/go7007-driver.c
@@ -108,14 +108,13 @@ static int go7007_load_encoder(struct go7007 *go)
return -1;
}
fw_len = fw_entry->size - 16;
- bounce = kmalloc(fw_len, GFP_KERNEL);
+ bounce = kmemdup(fw_entry->data + 16, fw_len, GFP_KERNEL);
if (bounce == NULL) {
v4l2_err(go, "unable to allocate %d bytes for "
"firmware transfer\n", fw_len);
release_firmware(fw_entry);
return -1;
}
- memcpy(bounce, fw_entry->data + 16, fw_len);
release_firmware(fw_entry);
if (go7007_interface_reset(go) < 0 ||
go7007_send_firmware(go, bounce, fw_len) < 0 ||
OpenPOWER on IntegriCloud