aboutsummaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/sur40.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2017-05-31 12:02:46 +0800
committerAlex Shi <alex.shi@linaro.org>2017-05-31 12:02:46 +0800
commitdc06d1ba220ca16ebbca598bb45242ec5e818cb2 (patch)
treeef66bd14901ec3a07cf65842a3b63884a64be529 /drivers/input/touchscreen/sur40.c
parent018ed21cf3b7cb618c63294793d63b23ce4afe24 (diff)
parenta898540914d4136f29bc738ce593c1c501006f23 (diff)
Merge branch 'linux-linaro-lsk-v4.1' into linux-linaro-lsk-v4.1-androidlsk-v4.1-17.06-androidlsk-v4.1-17.05-androidlinux-linaro-lsk-v4.1-android
Diffstat (limited to 'drivers/input/touchscreen/sur40.c')
-rw-r--r--drivers/input/touchscreen/sur40.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/sur40.c b/drivers/input/touchscreen/sur40.c
index a24eba5ea843..ee422cb5799a 100644
--- a/drivers/input/touchscreen/sur40.c
+++ b/drivers/input/touchscreen/sur40.c
@@ -488,6 +488,9 @@ static int sur40_probe(struct usb_interface *interface,
if (iface_desc->desc.bInterfaceClass != 0xFF)
return -ENODEV;
+ if (iface_desc->desc.bNumEndpoints < 5)
+ return -ENODEV;
+
/* Use endpoint #4 (0x86). */
endpoint = &iface_desc->endpoint[4].desc;
if (endpoint->bEndpointAddress != TOUCH_ENDPOINT)