diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 3205732ede..dd558696ba 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -1658,9 +1658,14 @@ CoreInternalFreePages ( goto Done; } + if (Entry == NULL) { + ASSERT (Entry != NULL); + Status = EFI_NOT_FOUND; + goto Done; + } + Alignment = DEFAULT_PAGE_ALLOCATION_GRANULARITY; - ASSERT (Entry != NULL); if ((Entry->Type == EfiACPIReclaimMemory) || (Entry->Type == EfiACPIMemoryNVS) || (Entry->Type == EfiRuntimeServicesCode) ||