Skip to content

Commit

Permalink
Input: vsxxxaa - fix code dropping bytes from queue
Browse files Browse the repository at this point in the history
I believe the intent of the code was to drop oldest bytes from the queue,
not the latest if we drop one byte and both latest and some oldest of we
are dropping more than one.

Acked-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
  • Loading branch information
Dmitry Torokhov committed Oct 28, 2014
1 parent 60183a6 commit 4db1f47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/mouse/vsxxxaa.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static void vsxxxaa_drop_bytes(struct vsxxxaa *mouse, int num)
if (num >= mouse->count) {
mouse->count = 0;
} else {
memmove(mouse->buf, mouse->buf + num - 1, BUFLEN - num);
memmove(mouse->buf, mouse->buf + num, BUFLEN - num);
mouse->count -= num;
}
}
Expand Down

0 comments on commit 4db1f47

Please sign in to comment.