aboutsummaryrefslogtreecommitdiff
path: root/hid-tmt300rs.c
diff options
context:
space:
mode:
authorkimi <kimi.h.kuparinen@gmail.com>2020-07-09 15:44:22 -0400
committerkimi <kimi.h.kuparinen@gmail.com>2020-07-09 15:44:22 -0400
commit6ab0a7ce8601e1b3ae24516d91e26ca116e8fce4 (patch)
tree983d6f78e3503dc8f78acfa843ef6f73eaae343b /hid-tmt300rs.c
parentab71fe85ea80dc912c5f5871b7036e8da6df33b5 (diff)
downloadhid-tmff2-6ab0a7ce8601e1b3ae24516d91e26ca116e8fce4.tar.gz
hid-tmff2-6ab0a7ce8601e1b3ae24516d91e26ca116e8fce4.zip
small progress
Diffstat (limited to 'hid-tmt300rs.c')
-rw-r--r--hid-tmt300rs.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/hid-tmt300rs.c b/hid-tmt300rs.c
index 3d678c8..2e2609a 100644
--- a/hid-tmt300rs.c
+++ b/hid-tmt300rs.c
@@ -892,7 +892,7 @@ err:
* */
static int t300rs_preinit(struct hid_device *hdev){
int ret;
- u8 *setup_packet;
+ u8 *setup_packet, *send_buffer;
/* this is sort of unnecessary, as later on I compile the interfaces etc
* into one struct, but for now this will do
@@ -900,9 +900,10 @@ static int t300rs_preinit(struct hid_device *hdev){
struct device *dev = &hdev->dev;
struct usb_interface *usbif = to_usb_interface(dev->parent);
struct usb_device *usbdev = interface_to_usbdev(usbif);
- struct urb *urb;
+ struct urb *urb;
setup_packet = kmalloc(8, GFP_ATOMIC);
+ send_buffer = kzalloc(8, GFP_ATOMIC);
memcpy(setup_packet, t300rs_ctrl_out, ARRAY_SIZE(t300rs_ctrl_out));
urb = usb_alloc_urb(0, GFP_ATOMIC);
@@ -911,7 +912,10 @@ static int t300rs_preinit(struct hid_device *hdev){
usbdev,
usb_sndctrlpipe(usbdev, 0),
setup_packet,
- NULL,
+ /* why is it important we have a pointer, when we send out 0 bytes?
+ * No clue.
+ * */
+ send_buffer,
0,
/* technically speaking this isn't an interrupt usb, but hey, this
* works.
@@ -926,6 +930,7 @@ static int t300rs_preinit(struct hid_device *hdev){
}
error:
+ kfree(send_buffer);
kfree(setup_packet);
return ret;
}