summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCpuDxeSmm
diff options
context:
space:
mode:
authorShenglei Zhang <shenglei.zhang@intel.com>2019-07-31 13:55:35 +0800
committerRay Ni <ray.ni@intel.com>2019-08-05 16:31:34 +0800
commitaefcf2f78a4800ab64697c7cb334c94b8ea468ae (patch)
tree6f175e9575eb73d2c82cf3d6f2e00c109093b562 /UefiCpuPkg/PiSmmCpuDxeSmm
parent4ac8ceb5d609bb0ca4c654a37b4d49f7c7ee3a7e (diff)
downloadedk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.tar.gz
edk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.tar.bz2
edk2-aefcf2f78a4800ab64697c7cb334c94b8ea468ae.zip
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')
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c
index a3b62f7787..d7af3b6d79 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));
//