diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index ee2f3f86a..e43ff69af 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -365,10 +365,12 @@ xf86MergeOutputClassOptions(int entityIndex, void **options) break; case BUS_PCI: for (i = 0; i < xf86_num_platform_devices; i++) { - if (MATCH_PCI_DEVICES(xf86_platform_devices[i].pdev, - entity->bus.id.pci)) { - dev = &xf86_platform_devices[i]; - break; + if (xf86_platform_devices[i].pdev) { + if (MATCH_PCI_DEVICES(xf86_platform_devices[i].pdev, + entity->bus.id.pci)) { + dev = &xf86_platform_devices[i]; + break; + } } } break; diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c index fe2142182..8a6be97aa 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -85,6 +85,9 @@ xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *bu bustype = StringToBusType(busid, &id); if (bustype == BUS_PCI) { struct pci_device *pPci = device->pdev; + if (!pPci) + return FALSE; + if (xf86ComparePciBusString(busid, ((pPci->domain << 8) | pPci->bus),