Skip to contentSkip to conversation

HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches

PATCH In review Ping Cheng 2 participants 2 messages May 20, 2015

Subsystems (2)
lore
Share & tools
lore

Ping Cheng

author
#0 lore raw

PATCH 1/1 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.

---
Hi Jiri, this patch is based on for-4.1/wacom. The issue was initially introduced in 4.1.

---
 drivers/hid/wacom_wac.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/hid/wacom_wac.c +3 -0
index 69c7df7..1cd80d2 100644
@@ -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 &&
Signature · 1 line
1.9.1
#1 lore raw
Quoted 9 lines · Ping Cheng

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.

---
Hi Jiri, this patch is based on for-4.1/wacom. The issue was initially introduced in 4.1.

Thanks. This is now applied to for-4.1/upstream-fixes, and this branch will be sent to Linus for pulling later today.

Signature · 2 lines
Jiri Kosina
SUSE Labs