linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input :Added Check for EV_ABS event params
@ 2015-04-21 18:19 Anshul Garg
  2015-04-21 18:29 ` Dmitry Torokhov
  0 siblings, 1 reply; 6+ messages in thread
From: Anshul Garg @ 2015-04-21 18:19 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input; +Cc: aksgarg1989, anshul.g

From: Anshul Garg <aksgarg1989@gmail.com>

while handling EV_ABS event in input_handle_abs_event
function added check for out of range event value from
input driver. As input driver sets the ABS params at
registration time so input core should ignore events out
of the range set by the input driver.

Signed-off-by: Anshul Garg <aksgarg1989@gmail.com>
---
 drivers/input/input.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/input/input.c b/drivers/input/input.c
index cc357f1..b1a6ff6 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -244,6 +244,11 @@ static int input_handle_abs_event(struct input_dev *dev,
 		pold = NULL;
 	}
 
+	if (dev->absinfo[code].minimum > *pval || dev->absinfo[code].maximum < *pval) {
+		/* Ignore event with out of range values */		
+		return INPUT_IGNORE_EVENT;
+	}
+
 	if (pold) {
 		*pval = input_defuzz_abs_event(*pval, *pold,
 						dev->absinfo[code].fuzz);
-- 
1.7.9.5


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-22 13:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-21 18:19 [PATCH] Input :Added Check for EV_ABS event params Anshul Garg
2015-04-21 18:29 ` Dmitry Torokhov
2015-04-21 21:56   ` Peter Hutterer
2015-04-22  6:35     ` Hans de Goede
2015-04-22 13:44   ` Anshul Garg
2015-04-22 13:57     ` Benjamin Tissoires

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).