[PATCH xf86-input-libinput] Bail when a sub-device is it's own parent

Keith Packard keithp at keithp.com
Sat Aug 13 16:28:20 UTC 2016


I don't understand when or how this can happen, but 'make check' in
libinput causes this many times:

[ 68331.672] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68331.996] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68335.260] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68340.920] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68346.768] (EE) libinput: litest Razer Razer BlackWidow 2013: Parent device is self?
[ 68347.088] (EE) libinput: litest wheel only device: Parent device is self?
[ 68360.940] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68362.068] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68375.844] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68437.241] (EE) libinput: litest wheel only device: Parent device is self?
[ 68438.890] (EE) libinput: litest Razer Razer BlackWidow 2013: Parent device is self?
[ 68439.412] (EE) libinput: litest wheel only device: Parent device is self?
[ 68439.789] (EE) libinput: litest wheel only device: Parent device is self?
[ 68440.517] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68441.480] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68444.369] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68445.457] (EE) libinput: litest wheel only device: Parent device is self?
[ 68445.676] (EE) libinput: litest wheel only device: Parent device is self?
[ 68445.856] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68472.397] (EE) libinput: litest wheel only device: Parent device is self?
[ 68473.932] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68519.772] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68519.929] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68520.585] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68525.565] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68525.829] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68528.352] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68528.873] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68535.077] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68547.133] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68547.880] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68737.228] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68738.520] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68749.744] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68753.952] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68767.376] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68773.556] (EE) libinput: litest Razer Razer BlackWidow 2013: Parent device is self?
[ 68773.876] (EE) libinput: litest Razer Razer BlackWidow 2013: Parent device is self?
[ 68774.716] (EE) libinput: litest wheel only device: Parent device is self?
[ 68780.732] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68788.920] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68833.044] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68890.340] (EE) libinput: litest Razer Razer BlackWidow 2013: Parent device is self?
[ 68893.524] (EE) libinput: litest ASUS ROG GLADIUS: Parent device is self?
[ 68898.560] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68898.668] (EE) libinput: litest USB Laser Game Mouse: Parent device is self?
[ 68949.992] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68959.572] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 68993.144] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 68999.248] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 69000.992] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 69001.384] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 69002.328] (EE) libinput: litest Microsoft Surface Type Cover: Parent device is self?
[ 69013.844] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?
[ 69014.792] (EE) libinput: litest ROCCAT ROCCAT Kone XTD: Parent device is self?

This is *not* a fix, simply a kludge that notices when it happens and
keeps things working in spite of this mistake.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 src/xf86libinput.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/xf86libinput.c b/src/xf86libinput.c
index 45385f7..9be4354 100644
--- a/src/xf86libinput.c
+++ b/src/xf86libinput.c
@@ -2589,6 +2589,10 @@ xf86libinput_pre_init(InputDriverPtr drv,
 			xf86IDrvMsg(pInfo, X_ERROR, "Failed to find parent device\n");
 			goto fail;
 		}
+		if (parent == pInfo) {
+			xf86IDrvMsg(pInfo, X_ERROR, "Parent device is self?\n");
+			goto fail;
+		}
 		xf86IDrvMsg(pInfo, X_INFO, "is a virtual subdevice\n");
 
 		parent_driver_data = parent->private;
-- 
2.8.1



More information about the xorg-devel mailing list