mirror of https://github.com/acidanthera/audk.git
UefiCpuPkg/PiSmmCpuDxeSmm: fix error handling
ASSERT() is not proper handling of allocation failures, it gets compiled out on RELEASE builds. Print a message and enter dead loop instead. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
parent
2e71876081
commit
4f441d024b
|
@ -879,6 +879,12 @@ PiCpuSmmEntry (
|
|||
//
|
||||
BufferPages = EFI_SIZE_TO_PAGES (SIZE_32KB + TileSize * (mMaxNumberOfCpus - 1));
|
||||
Buffer = AllocateAlignedCodePages (BufferPages, SIZE_4KB);
|
||||
if (Buffer == NULL) {
|
||||
DEBUG ((DEBUG_ERROR, "Failed to allocate %d pages.\n", BufferPages));
|
||||
CpuDeadLoop ();
|
||||
return EFI_OUT_OF_RESOURCES;
|
||||
}
|
||||
|
||||
ASSERT (Buffer != NULL);
|
||||
DEBUG ((DEBUG_INFO, "New Allcoated SMRAM SaveState Buffer (0x%08x, 0x%08x)\n", Buffer, EFI_PAGES_TO_SIZE (BufferPages)));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue