diff --git a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c index e0be9d6ac6a..ac125f6f486 100644 --- a/MdeModulePkg/Universal/BdsDxe/BdsEntry.c +++ b/MdeModulePkg/Universal/BdsDxe/BdsEntry.c @@ -390,18 +390,8 @@ BootBootOptions ( // // Attempt boot each boot option // - // MU_CHANGE [BEGINS]- Support infinite boot retries - for (Index = 0; ; Index++) { - if (Index == BootOptionCount) { - if (PcdGetBool (PcdSupportInfiniteBootRetries)) { - Index = 0; - } else { - break; - } - } - - // MU_CHANGE [ENDS]- Support infinite boot retries + for (Index = 0; Index < BootOptionCount; Index++) { // // According to EFI Specification, if a load option is not marked // as LOAD_OPTION_ACTIVE, the boot manager will not automatically @@ -1126,7 +1116,7 @@ BdsEntry ( BootSuccess = BootBootOptions (LoadOptions, LoadOptionCount, (BootManagerMenuStatus != EFI_NOT_FOUND) ? &BootManagerMenu : NULL); EfiBootManagerFreeLoadOptions (LoadOptions, LoadOptionCount); } - } while (BootSuccess); + } while (BootSuccess || PcdGetBool (PcdSupportInfiniteBootRetries)); // MU_CHANGE add PcdSupportInfiniteBootRetries support } if (BootManagerMenuStatus != EFI_NOT_FOUND) {