Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI: fix wrong assumption in pci_find_upstream_pcie_bridge

Current pci_find_upstream_pcie_bridge() has a wrong assumption that
pci_bus->self is NULL on the root pci bus. But it might not true on
some platforms. Because of this wrong assumption, current
pci_find_upstream_pcie_bridge() might cause endless loop. We must
check pci_bus->parent instead.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Kenji Kaneshige and committed by
Jesse Barnes
151ab36a d391f00f

+1 -1
+1 -1
drivers/pci/search.c
··· 29 29 if (pdev->is_pcie) 30 30 return NULL; 31 31 while (1) { 32 - if (!pdev->bus->self) 32 + if (!pdev->bus->parent) 33 33 break; 34 34 pdev = pdev->bus->self; 35 35 /* a p2p bridge */