summaryrefslogtreecommitdiff
path: root/drivers/input/joystick/iforce/iforce-usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/joystick/iforce/iforce-usb.c')
-rw-r--r--drivers/input/joystick/iforce/iforce-usb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c
index d96aa27dfcdc..db64adfbe1af 100644
--- a/drivers/input/joystick/iforce/iforce-usb.c
+++ b/drivers/input/joystick/iforce/iforce-usb.c
@@ -141,6 +141,9 @@ static int iforce_usb_probe(struct usb_interface *intf,
interface = intf->cur_altsetting;
+ if (interface->desc.bNumEndpoints < 2)
+ return -ENODEV;
+
epirq = &interface->endpoint[0].desc;
epout = &interface->endpoint[1].desc;