summaryrefslogtreecommitdiff
path: root/drivers/hid/hid-thrustmaster.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-thrustmaster.c')
-rw-r--r--drivers/hid/hid-thrustmaster.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hid/hid-thrustmaster.c b/drivers/hid/hid-thrustmaster.c
index 0c92b7f9b8b8..afdd778a10f0 100644
--- a/drivers/hid/hid-thrustmaster.c
+++ b/drivers/hid/hid-thrustmaster.c
@@ -158,6 +158,12 @@ static void thrustmaster_interrupts(struct hid_device *hdev)
return;
}
+ if (usbif->cur_altsetting->desc.bNumEndpoints < 2) {
+ kfree(send_buf);
+ hid_err(hdev, "Wrong number of endpoints?\n");
+ return;
+ }
+
ep = &usbif->cur_altsetting->endpoint[1];
b_ep = ep->desc.bEndpointAddress;