X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=extras%2Finput_id%2Finput_id.c;h=fededa3f7d0ab1f83141d0d9ec4b29315492918a;hp=3754cdefee2faf6bbeaae2597c2d1b834fa6c0e8;hb=22f9cb51c39a6fef1109bfd24e97d2fdda327a9e;hpb=5b9204787f1c3f1c7199939fd1328ee35b75127e;ds=sidebyside 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