aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-roccat-common.c
diff options
context:
space:
mode:
authorThomas Meyer <thomas@m3y3r.de>2011-11-17 17:43:40 -0500
committerJiri Kosina <jkosina@suse.cz>2011-11-19 18:42:42 -0500
commit4c33a885a5c8a9ad573249fa4ee4fb39af866599 (patch)
tree81493de9bc23d258c825d1bc0a89be950ed2a385 /drivers/hid/hid-roccat-common.c
parent1f59169e191c62e66dda86ac2bc953c915c8dddf (diff)
HID: roccat: Use kmemdup rather than duplicating its implementation
Signed-off-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/hid-roccat-common.c')
-rw-r--r--drivers/hid/hid-roccat-common.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hid/hid-roccat-common.c b/drivers/hid/hid-roccat-common.c
index edf898dee28b..f933221ba525 100644
--- a/drivers/hid/hid-roccat-common.c
+++ b/drivers/hid/hid-roccat-common.c
@@ -48,12 +48,10 @@ int roccat_common_send(struct usb_device *usb_dev, uint report_id,
48 char *buf; 48 char *buf;
49 int len; 49 int len;
50 50
51 buf = kmalloc(size, GFP_KERNEL); 51 buf = kmemdup(data, size, GFP_KERNEL);
52 if (buf == NULL) 52 if (buf == NULL)
53 return -ENOMEM; 53 return -ENOMEM;
54 54
55 memcpy(buf, data, size);
56
57 len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), 55 len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
58 HID_REQ_SET_REPORT, 56 HID_REQ_SET_REPORT,
59 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, 57 USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT,