diff --git a/device/device.c b/device/device.c index cf81979d74..76ecc8a0dd 100644 --- a/device/device.c +++ b/device/device.c @@ -278,8 +278,13 @@ static void read_resources(struct bus *bus) struct device *curdev; printk(BIOS_SPEW, "%s: %s(%s) read_resources bus %d link: %d\n", - __func__, bus->dev->dtsname, dev_path(bus->dev), + __func__, + (bus->dev ? bus->dev->dtsname : "No dtsname for NULL device"), + (bus->dev ? dev_path(bus->dev) : "No path for NULL device"), bus->secondary, bus->link); + if (!bus->dev) + printk(BIOS_WARNING, "%s: ERROR: bus->dev is NULL!\n", + __func__); /* Walk through all devices and find which resources they need. */ for (curdev = bus->children; curdev; curdev = curdev->sibling) { diff --git a/device/pci_device.c b/device/pci_device.c index 85293c5f97..322149c27e 100644 --- a/device/pci_device.c +++ b/device/pci_device.c @@ -1101,7 +1101,7 @@ unsigned int pci_scan_bus(struct bus *bus, unsigned int min_devfn, dev = pci_probe_dev(dev, bus, devfn); printk(BIOS_SPEW, "PCI: pci_scan_bus pci_probe_dev returns dev %p(%s)\n", - dev, dev->dtsname); + dev, dev ? dev->dtsname : "None (not found)"); /* If this is not a multi function device, or the device is * not present don't waste time probing another function.