浏览代码

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>
Dmitry Torokhov 10 年之前
父节点
当前提交
4db1f47c29
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/input/mouse/vsxxxaa.c

+ 1 - 1
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;
 	}
 }