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

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>

authored by

Roel Kluin and committed by
Jesse Barnes
35e1801e 9f5404d8

+1 -1
+1 -1
drivers/pci/hotplug/shpchp_pci.c
··· 137 137 busnr)) 138 138 break; 139 139 } 140 - if (busnr >= end) { 140 + if (busnr > end) { 141 141 ctrl_err(ctrl, 142 142 "No free bus for hot-added bridge\n"); 143 143 pci_dev_put(dev);