diff options
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-roccat-common.c | 4 | ||||
-rw-r--r-- | drivers/hid/hid-roccat-kone.c | 4 |
2 files changed, 2 insertions, 6 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, |
diff --git a/drivers/hid/hid-roccat-kone.c b/drivers/hid/hid-roccat-kone.c index e2072afb34bb..40090d602158 100644 --- a/drivers/hid/hid-roccat-kone.c +++ b/drivers/hid/hid-roccat-kone.c | |||
@@ -78,12 +78,10 @@ static int kone_send(struct usb_device *usb_dev, uint usb_command, | |||
78 | char *buf; | 78 | char *buf; |
79 | int len; | 79 | int len; |
80 | 80 | ||
81 | buf = kmalloc(size, GFP_KERNEL); | 81 | buf = kmemdup(data, size, GFP_KERNEL); |
82 | if (buf == NULL) | 82 | if (buf == NULL) |
83 | return -ENOMEM; | 83 | return -ENOMEM; |
84 | 84 | ||
85 | memcpy(buf, data, size); | ||
86 | |||
87 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), | 85 | len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0), |
88 | HID_REQ_SET_REPORT, | 86 | HID_REQ_SET_REPORT, |
89 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, | 87 | USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT, |