summaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc/pwc-ctrl.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-17 22:43:40 +0100
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-25 00:08:16 +0100
commit6d00c9aa2bb98909de21eaaf767b9ed76fe26f86 (patch)
treecd072572066593946ec899767bb49e5560cec154 /drivers/media/video/pwc/pwc-ctrl.c
parent[media] cx25821: Use kmemdup rather than duplicating its implementation (diff)
downloadlinux-6d00c9aa2bb98909de21eaaf767b9ed76fe26f86.tar.xz
linux-6d00c9aa2bb98909de21eaaf767b9ed76fe26f86.zip
[media] pwc: 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>
Diffstat (limited to 'drivers/media/video/pwc/pwc-ctrl.c')
-rw-r--r--drivers/media/video/pwc/pwc-ctrl.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/video/pwc/pwc-ctrl.c b/drivers/media/video/pwc/pwc-ctrl.c
index 3977addf3ba8..b42c239de9cf 100644
--- a/drivers/media/video/pwc/pwc-ctrl.c
+++ b/drivers/media/video/pwc/pwc-ctrl.c
@@ -113,10 +113,9 @@ static int _send_control_msg(struct pwc_device *pdev,
void *kbuf = NULL;
if (buflen) {
- kbuf = kmalloc(buflen, GFP_KERNEL); /* not allowed on stack */
+ kbuf = kmemdup(buf, buflen, GFP_KERNEL); /* not allowed on stack */
if (kbuf == NULL)
return -ENOMEM;
- memcpy(kbuf, buf, buflen);
}
rc = usb_control_msg(pdev->udev, usb_sndctrlpipe(pdev->udev, 0),