From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: shenglei.zhang@intel.com) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by groups.io with SMTP; Tue, 30 Jul 2019 22:56:34 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jul 2019 22:56:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,328,1559545200"; d="scan'208";a="256028561" Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by orsmga001.jf.intel.com with ESMTP; 30 Jul 2019 22:56:32 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io, edk2-devel@lists.01.org Cc: Eric Dong , Ray Ni , Laszlo Ersek Subject: [PATCH 1/1] UefiCpuPkg/PiSmmCpuDxeSmm: Add check for pointer Pml5Entry Date: Wed, 31 Jul 2019 13:56:30 +0800 Message-Id: <20190731055630.14956-1-shenglei.zhang@intel.com> X-Mailer: git-send-email 2.18.0.windows.1 The pointer Pml5Entry, returned from call to function AllocatePageTableMemory, may be null. So add check for it. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Signed-off-by: Shenglei Zhang --- UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/PageTbl.c index a3b62f778741..d7af3b6d7941 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)); // -- 2.18.0.windows.1