UefiCpuPkg/PiSmmCpuDxeSmm: Add check for pointer Pml5Entry

The pointer Pml5Entry, returned from call to function
AllocatePageTableMemory, may be null.
So add check for it.

Cc: Eric Dong <eric.dong@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
Shenglei Zhang 2019-07-31 13:55:35 +08:00 committed by Ray Ni
parent 4ac8ceb5d6
commit aefcf2f78a
1 changed files with 1 additions and 0 deletions

View File

@ -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));
//