[PATCH evdev] Fail to set up devices that only have MT axes but no ABS_X/Y equivalents (#64029)

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 28 18:51:28 PDT 2013


The kernel should give us ABS_X/Y for backwards compat but some devices
don't. For now, ignore these devices as evdev is not suited to handle this
yet and will crash if a device is set up without axes (i.e.
pEvdev->vals == NULL) and later receives an event from an MT axis.

X.Org Bug 64029 <http://bugs.freedesktop.org/show_bug.cgi?id=64029>

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
not a solution, but it stops the crash

 src/evdev.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/evdev.c b/src/evdev.c
index 94f5499..aec1447 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1283,6 +1283,15 @@ EvdevAddAbsValuatorClass(DeviceIntPtr device, int want_scroll_axes)
             num_axes--;
         }
     }
+
+    /* device only has mt-axes. the kernel should give us ABS_X etc for
+       backwards compat but some devices don't have it. */
+    if (num_axes == 0 && num_mt_axes > 0) {
+        xf86IDrvMsg(pInfo, X_ERROR,
+                    "found only multitouch-axes. That shouldn't happen.\n");
+        goto out;
+    }
+
 #endif
 
 #ifdef HAVE_SMOOTH_SCROLLING
-- 
1.8.1.4



More information about the xorg-devel mailing list