Commit e8532257 authored by Jinjie Ruan's avatar Jinjie Ruan Committed by Hans Verkuil

media: cx231xx: Switch to use kmemdup() helper

Use kmemdup() helper instead of open-coding to
simplify the code.
Signed-off-by: default avatarJinjie Ruan <ruanjinjie@huawei.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent 05b34200
......@@ -751,10 +751,9 @@ int cx231xx_ep5_bulkout(struct cx231xx *dev, u8 *firmware, u16 size)
int ret = -ENOMEM;
u32 *buffer;
buffer = kzalloc(4096, GFP_KERNEL);
buffer = kmemdup(firmware, 4096, GFP_KERNEL);
if (buffer == NULL)
return -ENOMEM;
memcpy(&buffer[0], firmware, 4096);
ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 5),
buffer, 4096, &actlen, 2000);
......
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