From: Dmitry Torokhov Date: Fri, 24 Oct 2014 22:33:53 +0000 (-0700) Subject: Input: vsxxxaa - fix code dropping bytes from queue X-Git-Tag: v3.18-rc3~11^2~5 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4db1f47c29bd19e2069fb877620540db2a51a572;p=uclinux-h8%2Flinux.git Input: vsxxxaa - fix code dropping bytes from queue 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 Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c index 38298232124f..abd494411e69 100644 --- a/drivers/input/mouse/vsxxxaa.c +++ b/drivers/input/mouse/vsxxxaa.c @@ -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; } }