--- libdrm-2.4.26/tests/drmtest.c.orig 2011-07-26 04:19:11.588181734 +0200 +++ libdrm-2.4.26/tests/drmtest.c 2011-07-26 04:19:55.473496395 +0200 @@ -79,11 +79,13 @@ int drm_open_matching(const char *pci_gl device = udev_device_new_from_syspath(udev, path); parent = udev_device_get_parent(device); /* Filter out KMS output devices. */ - if (strcmp(udev_device_get_subsystem(parent), "pci") != 0) - continue; - pci_id = udev_device_get_property_value(parent, "PCI_ID"); - if (fnmatch(pci_glob, pci_id, 0) != 0) - continue; + if (parent) { + if (strcmp(udev_device_get_subsystem(parent), "pci") != 0) + continue; + pci_id = udev_device_get_property_value(parent, "PCI_ID"); + if (fnmatch(pci_glob, pci_id, 0) != 0) + continue; + } fd = open(udev_device_get_devnode(device), O_RDWR); if (fd < 0) continue;