diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c index 4a3fc46acf..24b7c1364a 100644 --- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c +++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BBSsupport.c @@ -438,6 +438,8 @@ OrderLegacyBootOption4SameType ( // Record the EnBootOption and DisBootOption according to the DevOrder // NewBootOption = AllocatePool (DevOrderCount * sizeof (UINT16)); + ASSERT (NewBootOption != NULL); + while (DevOrderCount-- != 0) { for (Index = 0; Index < mBootOptionBbsMappingCount; Index++) { if (mBootOptionBbsMapping[Index].BbsIndex == (DevOrder[DevOrderCount] & 0xFF)) {