[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANq1E4QWcngK8VeEcKzx-5XqUan3kBRKjk7HXjE_SRV+9Umb5g@mail.gmail.com>
Date: Sun, 20 Jul 2014 11:50:55 +0200
From: David Herrmann <dh.herrmann@...il.com>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: "open list:HID CORE LAYER" <linux-input@...r.kernel.org>,
Benson Leung <bleung@...omium.org>,
Andrew de los Reyes <adlr@...omium.org>,
Henrik Rydberg <rydberg@...omail.se>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Input: fix defuzzing logic
Hi
On Sun, Jul 20, 2014 at 1:49 AM, Dmitry Torokhov
<dmitry.torokhov@...il.com> wrote:
> We attempt to remove noise from coordinates reported by devices in
> input_handle_abs_event(), unfortunately, unless we were dropping the
> event altogether, we were ignoring the adjusted value and were passing
> on the original value instead.
Reviewed-by: David Herrmann <dh.herrmann@...il.com>
Thanks
David
> Reviewed-by: Andrew de los Reyes <adlr@...omium.org>
> Reviewed-by: Benson Leung <bleung@...omium.org>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>
> ---
> drivers/input/input.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/input/input.c b/drivers/input/input.c
> index 1c4c0db..29ca0bb 100644
> --- a/drivers/input/input.c
> +++ b/drivers/input/input.c
> @@ -257,9 +257,10 @@ static int input_handle_abs_event(struct input_dev *dev,
> }
>
> static int input_get_disposition(struct input_dev *dev,
> - unsigned int type, unsigned int code, int value)
> + unsigned int type, unsigned int code, int *pval)
> {
> int disposition = INPUT_IGNORE_EVENT;
> + int value = *pval;
>
> switch (type) {
>
> @@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev,
> break;
> }
>
> + *pval = value;
> return disposition;
> }
>
> @@ -365,7 +367,7 @@ static void input_handle_event(struct input_dev *dev,
> {
> int disposition;
>
> - disposition = input_get_disposition(dev, type, code, value);
> + disposition = input_get_disposition(dev, type, code, &value);
>
> if ((disposition & INPUT_PASS_TO_DEVICE) && dev->event)
> dev->event(dev, type, code, value);
>
> --
> Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists