OSDN Git Service

Merge tag 'pci-v3.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaa...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Nov 2014 19:33:06 +0000 (11:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 6 Nov 2014 19:33:06 +0000 (11:33 -0800)
Pull PCI fix from Bjorn Helgaas:
 "This fixes an oops when enabling SR-IOV VF devices.  The oops is a
  regression I added by configuring all devices during enumeration.

    - Don't oops on virtual buses in acpi_pci_get_bridge_handle() (Yinghai Lu)"

* tag 'pci-v3.18-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
  PCI: Don't oops on virtual buses in acpi_pci_get_bridge_handle()

include/linux/pci-acpi.h

index 64dacb7..24c7728 100644 (file)
@@ -41,8 +41,13 @@ static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus)
 
        if (pci_is_root_bus(pbus))
                dev = pbus->bridge;
-       else
+       else {
+               /* If pbus is a virtual bus, there is no bridge to it */
+               if (!pbus->self)
+                       return NULL;
+
                dev = &pbus->self->dev;
+       }
 
        return ACPI_HANDLE(dev);
 }