Эх сурвалжийг харах

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>
Zhang, Yang Z 13 жил өмнө
parent
commit
780dbcd0ee
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      drivers/xen/pci.c

+ 1 - 1
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)