summaryrefslogtreecommitdiffstats
path: root/kernel/drivers/input/misc/powermate.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/drivers/input/misc/powermate.c')
-rw-r--r--kernel/drivers/input/misc/powermate.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/kernel/drivers/input/misc/powermate.c b/kernel/drivers/input/misc/powermate.c
index 63b539d3d..84909a12f 100644
--- a/kernel/drivers/input/misc/powermate.c
+++ b/kernel/drivers/input/misc/powermate.c
@@ -307,6 +307,9 @@ static int powermate_probe(struct usb_interface *intf, const struct usb_device_i
int error = -ENOMEM;
interface = intf->cur_altsetting;
+ if (interface->desc.bNumEndpoints < 1)
+ return -EINVAL;
+
endpoint = &interface->endpoint[0].desc;
if (!usb_endpoint_is_int_in(endpoint))
return -EIO;