During the suspend/resume programming I came to an issue that first 4KB of
[coreboot.git] / src / devices / pci_ops.c
index c6d85f284e2af3b8ff4ce7ff1a2c97cfab7cf733..08792f209d7ca80419cfbbbfc89e7e4564d97621 100644 (file)
 
 static struct bus *get_pbus(device_t dev)
 {
-       struct bus *pbus = dev->bus;
+       struct bus *pbus;
+
+       if (!dev)
+               printk_alert("get_pbus: dev is NULL!\n");
+
+       pbus = dev->bus;
+
        while(pbus && pbus->dev && !ops_pci_bus(pbus)) {
                if (pbus == pbus->dev->bus) {
                        printk_alert("%s in endless loop looking for a parent "