summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPing Cheng <pinglinux@gmail.com>2016-06-23 19:55:11 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2016-06-23 22:38:45 +0200
commit9e72ac7492149a229ce9039c680849cb682d7092 (patch)
tree9cb12623238ce9b1ae7cdee435f2aa3aeaed1594
parentInput: wacom_w8001 - w8001_MAX_LENGTH should be 13 (diff)
downloadlinux-9e72ac7492149a229ce9039c680849cb682d7092.tar.xz
linux-9e72ac7492149a229ce9039c680849cb682d7092.zip
Input: wacom_w8001 - ignore invalid pen data packets
ThinkPad X60 Tablet PC (pen only device) sometime posts packets that are larger than W8001_PKTLEN_TPCPEN. Reported-by: Chris J Arges <christopherarges@gmail.com> Tested-by: Chris J Arges <christopherarges@gmail.com> Signed-off-by: Ping Cheng <pingc@wacom.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r--drivers/input/touchscreen/wacom_w8001.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index b1b412766da8..0c9191cf324d 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) sometimes
+ * 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;