mirror of
https://github.com/systemd/systemd.git
synced 2024-12-26 03:22:00 +03:00
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.
This commit is contained in:
parent
2ad6af0fc0
commit
22f9cb51c3
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user