From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: vsxxxaa - fix code dropping bytes from queue
Date: Sat, 25 Oct 2014 14:39:40 +0200 [thread overview]
Message-ID: <20141025123939.GW28215@lug-owl.de> (raw)
In-Reply-To: <20141024223846.GA1914@dtor-ws>
[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]
On Fri, 2014-10-24 15:38:46 -0700, Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> 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.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
> drivers/input/mouse/vsxxxaa.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/input/mouse/vsxxxaa.c b/drivers/input/mouse/vsxxxaa.c
> index 3829823..abd4944 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;
> }
> }
Good catch! I fucked up the error recovery path.
Acked-by: Jan-Benedict Glaw <jbglaw@lug-owl.de>
MfG, JBG
--
Jan-Benedict Glaw jbglaw@lug-owl.de +49-172-7608481
Signature of: Eine Freie Meinung in einem Freien Kopf
the second : für einen Freien Staat voll Freier Bürger.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
prev parent reply other threads:[~2014-10-25 19:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-24 22:38 [PATCH] Input: vsxxxaa - fix code dropping bytes from queue Dmitry Torokhov
2014-10-25 12:39 ` Jan-Benedict Glaw [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141025123939.GW28215@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).