summaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/gtco.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-04-23 11:04:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2016-04-23 11:04:26 -0700
commitf9d1e7f389b3724ee7d6dde7427b10806bc66577 (patch)
tree70290718aa65445c9d6749d6862709d4e48ecf0f /drivers/input/tablet/gtco.c
parent09502d9fffd84d22dd1fba9fd4cf0d880a5da377 (diff)
parentdcc7597116c6713353522eb13c765063ff88bb89 (diff)
downloadop-kernel-dev-f9d1e7f389b3724ee7d6dde7427b10806bc66577.zip
op-kernel-dev-f9d1e7f389b3724ee7d6dde7427b10806bc66577.tar.gz
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov: "Just minor driver fixes" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: twl4030-vibra - do not reparent to grandparent Input: twl6040-vibra - do not reparent to grandparent Input: twl6040-vibra - ignore return value of schedule_work Input: twl6040-vibra - fix NULL pointer dereference by removing workqueue Input: pmic8xxx-pwrkey - fix algorithm for converting trigger delay Input: arizona-haptic - don't assign input_dev parent Input: clarify we want BTN_TOOL_<name> on proximity Input: xpad - add Mad Catz FightStick TE 2 VID/PID Input: gtco - fix crash on detecting device without endpoints
Diffstat (limited to 'drivers/input/tablet/gtco.c')
-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 3a7f3a4..7c18249 100644
--- a/drivers/input/tablet/gtco.c
+++ b/drivers/input/tablet/gtco.c
@@ -858,6 +858,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
@@ -879,7 +887,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;
OpenPOWER on IntegriCloud