PCI: Don't oops on virtual buses in acpi_pci_get_bridge_handle()
PCI: Don't oops on virtual buses in acpi_pci_get_bridge_handle()

acpi_pci_get_bridge_handle() returns the ACPI handle for the bridge device
(either a host bridge or a PCI-to-PCI bridge) leading to a PCI bus.  But
SR-IOV virtual functions can be on a virtual bus with no bridge leading to
it.  Return a NULL acpi_handle in this case instead of trying to
dereference the NULL pointer to the bridge.

This fixes a NULL pointer dereference oops in pci_get_hp_params() when
adding SR-IOV VF devices on virtual buses.

[bhelgaas: changelog, add comment in code]
Fixes: 6cd33649fa83 ("PCI: Add pci_configure_device() during enumeration")
Link: https://bugzilla.kernel.org/show_bug.cgi?id=87591
Reported-by: Chao Zhou <067ffc9ab145cc26ee0e09120d456288c918a337@intel.com>
Reported-by: Joerg Roedel <4688a6871ff025801033b3c4b039d55a29f8f937@8bytes.org>
Signed-off-by: Yinghai Lu <0674548f4d596393408a51d6287a76ebba2f42aa@kernel.org>
Signed-off-by: Bjorn Helgaas <f10ec01be0c6b54271af5c550cd257810bdf3268@google.com>
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs