···389390 pbus = pdev->subordinate;391 pci_dev_put(pdev);392+393+ /*394+ * This function may be called for a non-PCI device that has a395+ * PCI parent (eg. a disk under a PCI SATA controller). In that396+ * case pdev->subordinate will be NULL for the parent.397+ */398+ if (!pbus) {399+ dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");400+ pdev = NULL;401+ break;402+ }403 }404out:405 list_for_each_entry_safe(node, tmp, &device_list, node)