diff options
author | Shenglei Zhang <shenglei.zhang@intel.com> | 2019-07-31 13:55:35 +0800 |
---|---|---|
committer | Ray Ni <ray.ni@intel.com> | 2019-08-05 16:31:34 +0800 |
commit | aefcf2f78a4800ab64697c7cb334c94b8ea468ae (patch) | |
tree | 6f175e9575eb73d2c82cf3d6f2e00c109093b562 /UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | |
parent | 4ac8ceb5d609bb0ca4c654a37b4d49f7c7ee3a7e (diff) | |
download | edk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.zip edk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.tar.gz edk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.tar.bz2 |
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>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c index a3b62f7..d7af3b6 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c @@ -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));
//
|