diff --git a/OvmfPkg/Library/LoadLinuxLib/Linux.c b/OvmfPkg/Library/LoadLinuxLib/Linux.c index cd673aa087..4a3e2c13cb 100644 --- a/OvmfPkg/Library/LoadLinuxLib/Linux.c +++ b/OvmfPkg/Library/LoadLinuxLib/Linux.c @@ -280,8 +280,12 @@ SetupLinuxMemmap ( // Enlarge space here, because we will allocate pool now. // MemoryMapSize += EFI_PAGE_SIZE; - MemoryMap = AllocatePool (MemoryMapSize); - ASSERT (MemoryMap != NULL); + Status = gBS->AllocatePool ( + EfiLoaderData, + MemoryMapSize, + (VOID **) &MemoryMap + ); + ASSERT_EFI_ERROR (Status); // // Get System MemoryMap