Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50c5d36d authored by Dmitry Torokhov's avatar Dmitry Torokhov Committed by Dmitry Torokhov
Browse files

Input: fix defuzzing logic



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.

Cc: stable@vger.kernel.org
Reviewed-by: default avatarAndrew de los Reyes <adlr@chromium.org>
Reviewed-by: default avatarBenson Leung <bleung@chromium.org>
Reviewed-by: default avatarDavid Herrmann <dh.herrmann@gmail.com>
Reviewed-by: default avatarHenrik Rydberg <rydberg@euromail.se>
Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
parent 67f4aef2
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);