MdeModulePkg: Skip invalid bus number scanning in PciBusDxe driver

When PcdPciDisableBusEnumeration is enabled, the PciBus driver
might get into a dead loop if the secondary bus register on PCI
bridge is not programmed or programmed improperly. Adding this
check to avoid any potential dead loop caused by this.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Lee Leahy <Leroy.p.leahy@intel.com>
This commit is contained in:
Ma, Maurice 2016-05-17 05:26:06 +08:00 committed by Feng Tian
parent 720eea6aa8
commit c28306c3d6
1 changed files with 8 additions and 0 deletions

View File

@ -164,6 +164,14 @@ PciPciDeviceInfoCollector (
return Status; return Status;
} }
//
// Ensure secondary bus number is greater than the primary bus number to avoid
// any potential dead loop when PcdPciDisableBusEnumeration is set to TRUE
//
if (SecBus <= StartBusNumber) {
break;
}
// //
// Get resource padding for PPB // Get resource padding for PPB
// //