Skip to content

Commit

Permalink
Input: wacom_w8001 - ignore invalid pen data packets
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ping Cheng authored and Dmitry Torokhov committed Jun 23, 2016
1 parent 12afb34 commit 9e72ac7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/input/touchscreen/wacom_w8001.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9e72ac7

Please sign in to comment.