summaryrefslogtreecommitdiff
path: root/drivers/input/tablet/aiptek.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-01-04 15:25:34 (GMT)
committerAl Viro <viro@zeniv.linux.org.uk>2016-01-04 15:25:34 (GMT)
commit7e935c7ca1e6c398f11edac5beabfc4348e3b3a4 (patch)
tree86da864ba6341bd86b5f5450c611f918722237b2 /drivers/input/tablet/aiptek.c
parentc62432b40b5e03c25faf2c8f8547bba4908b8945 (diff)
parente9d408e107db9a554b36c3a79f67b37dd3e16da0 (diff)
downloadlinux-7e935c7ca1e6c398f11edac5beabfc4348e3b3a4.tar.xz
Merge branch 'memdup_user_nul' into work.misc
Diffstat (limited to 'drivers/input/tablet/aiptek.c')
-rw-r--r--drivers/input/tablet/aiptek.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index e7f966d..78ca448 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1819,6 +1819,14 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
input_set_abs_params(inputdev, ABS_TILT_Y, AIPTEK_TILT_MIN, AIPTEK_TILT_MAX, 0, 0);
input_set_abs_params(inputdev, ABS_WHEEL, AIPTEK_WHEEL_MIN, AIPTEK_WHEEL_MAX - 1, 0, 0);
+ /* Verify that a device really has an endpoint */
+ if (intf->altsetting[0].desc.bNumEndpoints < 1) {
+ dev_err(&intf->dev,
+ "interface has %d endpoints, but must have minimum 1\n",
+ intf->altsetting[0].desc.bNumEndpoints);
+ err = -EINVAL;
+ goto fail3;
+ }
endpoint = &intf->altsetting[0].endpoint[0].desc;
/* Go set up our URB, which is called when the tablet receives
@@ -1861,6 +1869,7 @@ aiptek_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (i == ARRAY_SIZE(speeds)) {
dev_info(&intf->dev,
"Aiptek tried all speeds, no sane response\n");
+ err = -EINVAL;
goto fail3;
}