aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/pci/probe.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index e3cf8a2e6292..7c8ca351beae 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -838,16 +838,12 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, int pass)
838 goto out; 838 goto out;
839 } 839 }
840 840
841 if (max >= bus->busn_res.end) {
842 dev_warn(&dev->dev, "can't allocate child bus %02x from %pR\n",
843 max, &bus->busn_res);
844 goto out;
845 }
846
847 /* Clear errors */ 841 /* Clear errors */
848 pci_write_config_word(dev, PCI_STATUS, 0xffff); 842 pci_write_config_word(dev, PCI_STATUS, 0xffff);
849 843
850 /* The bus will already exist if we are rescanning */ 844 /* Prevent assigning a bus number that already exists.
845 * This can happen when a bridge is hot-plugged, so in
846 * this case we only re-scan this bus. */
851 child = pci_find_bus(pci_domain_nr(bus), max+1); 847 child = pci_find_bus(pci_domain_nr(bus), max+1);
852 if (!child) { 848 if (!child) {
853 child = pci_add_new_bus(bus, dev, max+1); 849 child = pci_add_new_bus(bus, dev, max+1);