summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZhang, Yang Z <yang.z.zhang@intel.com>2012-05-22 10:40:16 +0200
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2012-05-30 16:16:35 +0200
commit780dbcd0eedec6528d777b668019dabb36badf1a (patch)
treebde78829e272a7a7930dd25f40ee28c5fd56fa13
parentxen/events: Add WARN_ON when quick lookup found invalid type. (diff)
downloadlinux-780dbcd0eedec6528d777b668019dabb36badf1a.tar.xz
linux-780dbcd0eedec6528d777b668019dabb36badf1a.zip
xen/pci: Check for PCI bridge before using it.
Some SR-IOV devices may use more than one bus number, but there is no real bridges because that have internal routing mechanism. So need to check whether the bridge is existing before using it. Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
-rw-r--r--drivers/xen/pci.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/pci.c b/drivers/xen/pci.c
index b84bf0b6cc34..18fff88254eb 100644
--- a/drivers/xen/pci.c
+++ b/drivers/xen/pci.c
@@ -59,7 +59,7 @@ static int xen_add_device(struct device *dev)
#ifdef CONFIG_ACPI
handle = DEVICE_ACPI_HANDLE(&pci_dev->dev);
- if (!handle)
+ if (!handle && pci_dev->bus->bridge)
handle = DEVICE_ACPI_HANDLE(pci_dev->bus->bridge);
#ifdef CONFIG_PCI_IOV
if (!handle && pci_dev->is_virtfn)