Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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,