On 07/31/19 07:56, Shenglei Zhang wrote:
> The pointer Pml5Entry, returned from call to function
> AllocatePageTableMemory, may be null.
> So add check for it.
> 
> Cc: Eric Dong <eric.d...@intel.com>
> Cc: Ray Ni <ray...@intel.com>
> Cc: Laszlo Ersek <ler...@redhat.com>
> Signed-off-by: Shenglei Zhang <shenglei.zh...@intel.com>
> ---
>  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));
>      //
> 

I'm quite unhappy about this *pattern* in "PageTbl.c", but I must agree
that this patch at least makes the new 5-level paging code consistent
with the pattern.

Laszlo

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#44675): https://edk2.groups.io/g/devel/message/44675
Mute This Topic: https://groups.io/mt/32662314/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to