Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <jbglaw@lug-owl.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+1 -1
+1 -1
drivers/input/mouse/vsxxxaa.c
··· 128 128 if (num >= mouse->count) { 129 129 mouse->count = 0; 130 130 } else { 131 - memmove(mouse->buf, mouse->buf + num - 1, BUFLEN - num); 131 + memmove(mouse->buf, mouse->buf + num, BUFLEN - num); 132 132 mouse->count -= num; 133 133 } 134 134 }