···389389390390 pbus = pdev->subordinate;391391 pci_dev_put(pdev);392392+393393+ /*394394+ * This function may be called for a non-PCI device that has a395395+ * PCI parent (eg. a disk under a PCI SATA controller). In that396396+ * case pdev->subordinate will be NULL for the parent.397397+ */398398+ if (!pbus) {399399+ dev_dbg(&pdev->dev, "Not a PCI-to-PCI bridge\n");400400+ pdev = NULL;401401+ break;402402+ }392403 }393404out:394405 list_for_each_entry_safe(node, tmp, &device_list, node)