Thread (3 messages) 3 messages, 3 authors, 2016-06-23

[PATCH 2/2] Input: wacom_w8001 - Ignore invalid pen data packets

flat view
STALE3765d REVIEWED: 1 (0M)

From: Ping Cheng <hidden>
Date: 2016-05-24 03:04:39
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

1 review trailer.

ThinkPad X60 Tablet PC (pen only device) sometime posts
packets that are larger than W8001_PKTLEN_TPCPEN.

Reported-by: Chris J Arges <redacted>
Tested-by: Chris J Arges <redacted>
Signed-off-by: Ping Cheng <redacted>
---
 drivers/input/touchscreen/wacom_w8001.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index b1b4127..d5dcda2 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -339,6 +339,15 @@ static irqreturn_t w8001_interrupt(struct serio *serio,
 		w8001->idx = 0;
 		parse_multi_touch(w8001);
 		break;
+
+	default:
+		/*
+		 * ThinkPad X60 Tablet PC (pen only device) sometime sends
+		 * invalid data packets that are larger than W8001_PKTLEN_TPCPEN.
+		 * Let's start over again.
+		 */
+		if (!w8001->touch_dev && w8001->idx > W8001_PKTLEN_TPCPEN - 1)
+			w8001->idx = 0;
 	}
 
 	return IRQ_HANDLED;
-- 
1.9.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help