summaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2015-05-19 17:42:02 -0700
committerJiri Kosina <jkosina@suse.cz>2015-05-20 12:00:29 +0200
commit26ba61f871b4aa9958bcebffcbeb558094d75928 (patch)
treefbb6190cbfce6bda0e6e075b7bdb97d6088240fe /drivers/hid
parent849eca7b9dae0364e2fbe8afdf0fb610d12c9c8f (diff)
downloadblackbird-op-linux-26ba61f871b4aa9958bcebffcbeb558094d75928.tar.gz
blackbird-op-linux-26ba61f871b4aa9958bcebffcbeb558094d75928.zip
HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches
We assumed all touch interfaces report touch data. But, Bamboo and Intuos non-touch devices report express keys on touch interface. We need to check touch_max before counting touches. Reported-by: Tasos Sahanidis <tasos@tasossah.com> Signed-off-by: Ping Cheng <pingc@wacom.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/wacom_wac.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index fa54d3290659..adf959dcfa5d 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1072,6 +1072,9 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom)
int count = 0;
int i;
+ if (!touch_max)
+ return 0;
+
/* non-HID_GENERIC single touch input doesn't call this routine */
if ((touch_max == 1) && (wacom->features.type == HID_GENERIC))
return wacom->hid_data.tipswitch &&
OpenPOWER on IntegriCloud