Thread (10 messages) 10 messages, 5 authors, 2013-11-21

[PATCH 1/3] Only process ABS_MT_SLOT where there are slots available

From: Benjamin Tissoires <hidden>
Date: 2013-11-20 21:33:23
Also in: lkml
Subsystem: input (keyboard, mouse, joystick, touchscreen) drivers, the rest · Maintainers: Dmitry Torokhov, Linus Torvalds

From: Antonio Ospite <redacted>

This fixes the case when a non-multitouch device happens to have a HID
code equal to ABS_MT_SLOT, like the Sony Sixaxis has for the left dpad
analog control.

Updated to latest tree by Benjamin Tissoires.

Signed-off-by: Benjamin Tissoires <redacted>
---

This patch was sent back in 2011 by Antonio and it was forgotten in the depth
of the LKML:
http://www.spinics.net/lists/linux-input/msg16881.html
Resurecting it now, as the bug is still there.

Antonio, could you please tell me if you still add your Signed-of-by line and
if I can keep your from?

Cheers,
Benjamin
drivers/input/input.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/input/input.c b/drivers/input/input.c
index fb513da..1198785 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -213,12 +213,12 @@ static int input_handle_abs_event(struct input_dev *dev,
 	bool is_mt_event;
 	int *pold;
 
-	if (code == ABS_MT_SLOT) {
+	if (code == ABS_MT_SLOT && mt) {
 		/*
 		 * "Stage" the event; we'll flush it later, when we
 		 * get actual touch data.
 		 */
-		if (mt && *pval >= 0 && *pval < mt->num_slots)
+		if (*pval >= 0 && *pval < mt->num_slots)
 			mt->slot = *pval;
 
 		return INPUT_IGNORE_EVENT;
-- 
1.8.3.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help