diff options
Diffstat (limited to 'drivers/hid/hid-roccat-common.c')
-rw-r--r-- | drivers/hid/hid-roccat-common.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/hid/hid-roccat-common.c b/drivers/hid/hid-roccat-common.c index b07e7f96a358..a6d93992c75a 100644 --- a/drivers/hid/hid-roccat-common.c +++ b/drivers/hid/hid-roccat-common.c | |||
@@ -49,12 +49,10 @@ int roccat_common_send(struct usb_device *usb_dev, uint report_id, | |||
49 | char *buf; | 49 | char *buf; |
50 | int len; | 50 | int len; |
51 | 51 | ||
52 | buf = kmalloc(size, GFP_KERNEL); | 52 | buf = kmemdup(data, size, GFP_KERNEL); |
53 | if (buf == NULL) | 53 | if (buf == NULL) |
54 | return -ENOMEM; | 54 | return -ENOMEM; |
55 | 55 | ||
56 | memcpy(buf, data, size); | ||
57 | |||
58 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), | 56 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), |
59 | HID_REQ_SET_REPORT, | 57 | HID_REQ_SET_REPORT, |
60 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, | 58 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, |