From: Zhang, Yang Z Date: Tue, 22 May 2012 08:40:16 +0000 (+0000) Subject: xen/pci: Check for PCI bridge before using it. X-Git-Tag: next-20120724~28^2~13^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=eff7494e3269611c81689046ba235b3db0a9fdfe;p=karo-tx-linux.git 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 Signed-off-by: Konrad Rzeszutek Wilk --- 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)