mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 09:41:44 +00:00
[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>
This commit is contained in:
parent
0ceaec188e
commit
6d00c9aa2b
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user