Input: hgpk - detect simple mode overflows
authorDaniel Drake <dsd@laptop.org>
Mon, 15 Nov 2010 09:28:54 +0000 (01:28 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 15 Nov 2010 09:33:47 +0000 (01:33 -0800)
Based on work by Paul Fox.

Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/mouse/hgpk.c

index b54f074ec3075e7d1303df11e003531eb74bfe17..7f6cb32d177a10e74b987ecb36ff040109939f15 100644 (file)
@@ -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");