From dea1d1a3906b98b491e9760b3304f881c6afec5e Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 29 Apr 2013 11:48:12 +1000 Subject: Fail to set up axes for devices that only have MT axes but no ABS_X/Y equivalents (#64029) 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 Signed-off-by: Peter Hutterer Reviewed-by: Benjamin Tissoires --- 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 -- cgit v1.2.3