Skip to content

Commit

Permalink
Input: hgpk - detect simple mode overflows
Browse files Browse the repository at this point in the history
Based on work by Paul Fox.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
  • Loading branch information
Daniel Drake authored and Dmitry Torokhov committed Nov 15, 2010
1 parent 87abb6b commit 67f56bb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/input/mouse/hgpk.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,11 @@ static void hgpk_process_simple_packet(struct psmouse *psmouse)
int x = packet[1] - ((packet[0] << 4) & 0x100);
int y = ((packet[0] << 3) & 0x100) - packet[2];

if (packet[0] & 0xc0)
hgpk_dbg(psmouse,
"overflow -- 0x%02x 0x%02x 0x%02x\n",
packet[0], packet[1], packet[2]);

if (hgpk_discard_decay_hack(psmouse, x, y)) {
if (tpdebug)
hgpk_dbg(psmouse, "discarding\n");
Expand Down

0 comments on commit 67f56bb

Please sign in to comment.