From 22f9cb51c39a6fef1109bfd24e97d2fdda327a9e Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Thu, 3 Dec 2009 10:16:49 +0100 Subject: [PATCH] input_id: Fix endless loop for non-input devices When being called on a device which is not in the "input" subsystem, or doesn't have an "input" parent, it got stuck in an endless loop. Unfortunately this includes the virtual/input/mice multiplexer, which exposes this bug on just about every system. --- extras/input_id/input_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/input_id/input_id.c b/extras/input_id/input_id.c index 3754cdefe..fededa3f7 100644 --- a/extras/input_id/input_id.c +++ b/extras/input_id/input_id.c @@ -143,7 +143,7 @@ int main (int argc, char** argv) /* walk up the parental chain until we find the real input device; the * argument is very likely a subdevice of this, like eventN */ - while (udev_device_get_sysattr_value(dev, "capabilities/key") == NULL) + while (dev != NULL && udev_device_get_sysattr_value(dev, "capabilities/key") == NULL) dev = udev_device_get_parent(dev); /* Use this as a flag that input devices were detected, so that this -- 2.30.2