[edk2-devel] [PATCH v2 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory

Zhang, Shenglei posted 3 patches 6 years, 3 months ago
[edk2-devel] [PATCH v2 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory
Posted by Zhang, Shenglei 6 years, 3 months ago
MapMemory is not initialized by FindGuardedMemoryMap
or CoreInternalAllocatePages which calls MapMemory.
So we give a 0 to it.

Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
 MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
index 9477b94044ba..b4cb48843fb7 100644
--- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
+++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
@@ -225,6 +225,8 @@ FindGuardedMemoryMap (
   UINTN                   BitsToUnitEnd;
   EFI_STATUS              Status;
 
+  MapMemory = 0;
+
   //
   // Adjust current map table depth according to the address to access
   //
-- 
2.18.0.windows.1


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

View/Reply Online (#49664): https://edk2.groups.io/g/devel/message/49664
Mute This Topic: https://groups.io/mt/39796173/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v2 3/3] MdeModulePkg/Mem: Initialize the variable MapMemory
Posted by Dandan Bi 6 years, 3 months ago
Reviewed-by: Dandan Bi <dandan.bi@intel.com>

Thanks,
Dandan

> -----Original Message-----
> From: Zhang, Shenglei
> Sent: Wednesday, October 30, 2019 10:09 PM
> To: devel@edk2.groups.io
> Cc: Bi, Dandan <dandan.bi@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: [PATCH v2 3/3] MdeModulePkg/Mem: Initialize the variable
> MapMemory
> 
> MapMemory is not initialized by FindGuardedMemoryMap or
> CoreInternalAllocatePages which calls MapMemory.
> So we give a 0 to it.
> 
> Cc: Dandan Bi <dandan.bi@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
> ---
>  MdeModulePkg/Core/Dxe/Mem/HeapGuard.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
> b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
> index 9477b94044ba..b4cb48843fb7 100644
> --- a/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
> +++ b/MdeModulePkg/Core/Dxe/Mem/HeapGuard.c
> @@ -225,6 +225,8 @@ FindGuardedMemoryMap (
>    UINTN                   BitsToUnitEnd;
>    EFI_STATUS              Status;
> 
> +  MapMemory = 0;
> +
>    //
>    // Adjust current map table depth according to the address to access
>    //
> --
> 2.18.0.windows.1


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

View/Reply Online (#49787): https://edk2.groups.io/g/devel/message/49787
Mute This Topic: https://groups.io/mt/39796173/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-