Commit d8d1f77e authored by Linus Torvalds's avatar Linus Torvalds

Input: fix ALPS protocol validation rules

We checked the wrong byte, causing the touchpad
to lose sync if an absolute packet is received
after a relative packet with negative Y displacement.
Signed-off-by: default avatarDmitry Torokhov <dtor_core@ameritech.net>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e6d7bb28
...@@ -175,8 +175,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse, struct pt_regs * ...@@ -175,8 +175,8 @@ static psmouse_ret_t alps_process_byte(struct psmouse *psmouse, struct pt_regs *
return PSMOUSE_BAD_DATA; return PSMOUSE_BAD_DATA;
/* Bytes 2 - 6 should have 0 in the highest bit */ /* Bytes 2 - 6 should have 0 in the highest bit */
if (psmouse->pktcnt > 1 && psmouse->pktcnt <= 6 && if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
(psmouse->packet[psmouse->pktcnt] & 0x80)) (psmouse->packet[psmouse->pktcnt-1] & 0x80))
return PSMOUSE_BAD_DATA; return PSMOUSE_BAD_DATA;
if (psmouse->pktcnt == 6) { if (psmouse->pktcnt == 6) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment