summaryrefslogtreecommitdiff
path: root/drivers/input/tablet
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-19 11:02:56 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-07-19 11:02:56 -0700
commit8c57a5e7b2820f349c95b8c8393fec1e0f4070d2 (patch)
tree8ef0f3c986968392ccdc70ca43b23eba729e2019 /drivers/input/tablet
parent0bb11e969f5367dcb661f9fcc77efd5d58a2c470 (diff)
parent6a5029e66404462a3322dba8e35615bd09332081 (diff)
Merge branch 'for-linus' into next
Sync up to bring in wacom_w8001 changes to avoid merge conflicts later.
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/gtco.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/input/tablet/gtco.c b/drivers/input/tablet/gtco.c
index 362ae3b5e188..abf09ac42ce4 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -857,6 +857,14 @@ static int gtco_probe(struct usb_interface *usbinterface,
goto err_free_buf;
}
+ /* Sanity check that a device has an endpoint */
+ if (usbinterface->altsetting[0].desc.bNumEndpoints < 1) {
+ dev_err(&usbinterface->dev,
+ "Invalid number of endpoints\n");
+ error = -EINVAL;
+ goto err_free_urb;
+ }
+
/*
* The endpoint is always altsetting 0, we know this since we know
* this device only has one interrupt endpoint
@@ -878,7 +886,7 @@ static int gtco_probe(struct usb_interface *usbinterface,
* HID report descriptor
*/
if (usb_get_extra_descriptor(usbinterface->cur_altsetting,
- HID_DEVICE_TYPE, &hid_desc) != 0){
+ HID_DEVICE_TYPE, &hid_desc) != 0) {
dev_err(&usbinterface->dev,
"Can't retrieve exta USB descriptor to get hid report descriptor length\n");
error = -EIO;