Skip to content

Commit

Permalink
UefiCpuPkg/PiSmmCpuDxeSmm: Add check for pointer Pml5Entry
Browse files Browse the repository at this point in the history
The pointer Pml5Entry, returned from call to function
AllocatePageTableMemory, may be null.
So add check for it.

Cc: Eric Dong <[email protected]>
Cc: Ray Ni <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Signed-off-by: Shenglei Zhang <[email protected]>
Reviewed-by: Ray Ni <[email protected]>
  • Loading branch information
shenglei10 authored and niruiyu committed Aug 5, 2019
1 parent 4ac8ceb commit aefcf2f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ SmmInitPageTable (
// Fill PML5 entry
//
Pml5Entry = (UINT64*)AllocatePageTableMemory (1);
ASSERT (Pml5Entry != NULL);
*Pml5Entry = (UINTN) Pml4Entry | mAddressEncMask | PAGE_ATTRIBUTE_BITS;
ZeroMem (Pml5Entry + 1, EFI_PAGE_SIZE - sizeof (*Pml5Entry));
//
Expand Down

0 comments on commit aefcf2f

Please sign in to comment.