diff options
author | Dave Airlie <airlied@redhat.com> | 2015-12-24 08:08:47 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-12-24 08:08:47 +1000 |
commit | 20f8e032e6dc7053ab803f488e2a8839cd2f69a6 (patch) | |
tree | 406b662934bffa205d90e9435bf96af7dc1a0cb0 /drivers/input/tablet | |
parent | ade1ba7346070709856d7e38f8d1a77b7aa710aa (diff) | |
parent | 5b726e06d6e8309e5c9ef4109a32caf27c71dfc8 (diff) | |
download | linux-20f8e032e6dc7053ab803f488e2a8839cd2f69a6.tar.gz |
Backmerge drm-fixes merge into Linus's tree into drm-next.
This merges '5b726e06d6e8309e5c9ef4109a32caf27c71dfc8' into drm-next
Just to resolve some merges to make Daniel's life easier.
Signed-off-by: DAve Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c index e7f966da6efa..78ca44840d60 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; } |