Core/Runtime/PeSmmHandler.c - Correct an excessive memory allocation

Signed-off-by: Eugene Myers <edmyers@cyberpackventures.com>
This commit is contained in:
Eugene Myers 2023-03-21 17:38:26 -04:00
parent 445d1fefe5
commit 473d544c10
1 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,14 @@ VOID
for(Index = SMI_HANDLER + 1; Index < NUM_PE_TYPE; Index++)
{
mGuestContextCommonSmm[Index].GuestContextPerCpu = AllocatePages (STM_SIZE_TO_PAGES(sizeof(STM_GUEST_CONTEXT_PER_CPU)) * mHostContextCommon.CpuNum);
mGuestContextCommonSmm[Index].GuestContextPerCpu =
AllocatePages (STM_SIZE_TO_PAGES(sizeof(STM_GUEST_CONTEXT_PER_CPU)));
}
if(mGuestContextCommonSmm[NUM_PE_TYPE - 1].GuestContextPerCpu == 0) // only need to check once
{
DEBUG((EFI_D_ERROR, "***ERROR*** Memory allocation failure for guest context\n"));
CpuDeadLoop();
}
DEBUG ((EFI_D_INFO, "PeInitStmHandlerSmm - initilizating PeSmmHandler Tables\n"));