Răsfoiți Sursa

PCI hotplug: shpchp: fix bus number check to avoid false positive

With for (busnr = 0; busnr <= end; busnr++) { ... } busnr reaches end + 1
after the loop.  So fix the "no busses available" check to look for just
busnr > end rather than >=.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Roel Kluin 16 ani în urmă
părinte
comite
35e1801ea6
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      drivers/pci/hotplug/shpchp_pci.c

+ 1 - 1
drivers/pci/hotplug/shpchp_pci.c

@@ -137,7 +137,7 @@ int __ref shpchp_configure_device(struct slot *p_slot)
 							busnr))
 					break;
 			}
-			if (busnr >= end) {
+			if (busnr > end) {
 				ctrl_err(ctrl,
 					 "No free bus for hot-added bridge\n");
 				pci_dev_put(dev);