Skip to content

Commit

Permalink
Input: fix defuzzing logic
Browse files Browse the repository at this point in the history
commit 50c5d36dab930b1f1b1e3348b8608aa8b9ee7610 upstream.

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: Andrew de los Reyes <[email protected]>
Reviewed-by: Benson Leung <[email protected]>
Reviewed-by: David Herrmann <[email protected]>
Reviewed-by: Henrik Rydberg <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: franciscofranco <[email protected]>
  • Loading branch information
dtor authored and franciscofranco committed Apr 17, 2015
1 parent c76306a commit f5d7111
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/input/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,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) {

Expand Down Expand Up @@ -357,6 +358,7 @@ static int input_get_disposition(struct input_dev *dev,
break;
}

*pval = value;
return disposition;
}

Expand All @@ -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);
Expand Down

0 comments on commit f5d7111

Please sign in to comment.