Commit 9edae492 authored by sayli karnik's avatar sayli karnik Committed by Greg Kroah-Hartman

staging: greybus: es2: Use kmemdup instead of kmalloc and memcpy

This patch replaces kmalloc and memcpy with kmemdup for duplication of
memory.
Signed-off-by: default avatarsayli karnik <karniksayli1995@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0af1bd5
......@@ -175,10 +175,9 @@ static int output_sync(struct es2_ap_dev *es2, void *req, u16 size, u8 cmd)
u8 *data;
int retval;
data = kmalloc(size, GFP_KERNEL);
data = kmemdup(req, size, GFP_KERNEL);
if (!data)
return -ENOMEM;
memcpy(data, req, size);
retval = usb_control_msg(udev, usb_sndctrlpipe(udev, 0),
cmd,
......
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