]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/hid/hid-roccat-common.c
Merge branches 'hyperv', 'multitouch', 'roccat', 'upstream', 'upstream-fixes', 'wacom...
[karo-tx-linux.git] / drivers / hid / hid-roccat-common.c
index b07e7f96a3580e0168bce0a89e86b8091c94cd7a..a6d93992c75a4ee8d593729f867ca582975e0629 100644 (file)
@@ -49,12 +49,10 @@ int roccat_common_send(struct usb_device *usb_dev, uint report_id,
        char *buf;
        int len;
 
-       buf = kmalloc(size, GFP_KERNEL);
+       buf = kmemdup(data, size, GFP_KERNEL);
        if (buf == NULL)
                return -ENOMEM;
 
-       memcpy(buf, data, size);
-
        len = usb_control_msg(usb_dev, usb_sndctrlpipe(usb_dev, 0),
                        HID_REQ_SET_REPORT,
                        USB_TYPE_CLASS | USB_RECIP_INTERFACE | USB_DIR_OUT,