]> asedeno.scripts.mit.edu Git - linux.git/commit
PCI: Don't scan random busses in pci_scan_bridge()
authorAndreas Noever <andreas.noever@gmail.com>
Thu, 23 Jan 2014 20:59:28 +0000 (21:59 +0100)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 11 Feb 2014 22:21:08 +0000 (15:21 -0700)
commitfc1b253141b360f9c669d391b4ff663b984ef0c9
tree340f103d698872c8ebbeb4712a7e512936bc4a68
parentc95b0bd6ca3dbb1abf8394c38d26df65d890cb9a
PCI: Don't scan random busses in pci_scan_bridge()

When assigning a new bus number in pci_scan_bridge we check whether
max+1 is free by calling pci_find_bus. If it does already exist then we
assume that we are rescanning and that this is the right bus to scan.

This is fragile. If max+1 lies outside of bus->busn_res.end then we will
rescan some random bus from somewhere else in the hierachy. This patch
checks for this case and prints a warning.

[bhelgaas: add parent/child bus number info to dev_warn()]
Signed-off-by: Andreas Noever <andreas.noever@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/probe.c