Reviewed-by: Yao, Jiewen <[email protected]>

-----Original Message-----
From: Zeng, Star 
Sent: Monday, July 27, 2015 8:34 AM
To: [email protected]
Cc: Yao, Jiewen
Subject: [PATCH] MdeModulePkg PiSmmIpl: Use AllocateZeroPool() for 
FullSmramRanges

to instead of AllocatePool() to ensure the data is clean for the following 
consumption.

Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <[email protected]>
---
 MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c 
b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
index 9b26977..c534ee3 100644
--- a/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
+++ b/MdeModulePkg/Core/PiSmmCore/PiSmmIpl.c
@@ -1293,7 +1293,7 @@ GetFullSmramRanges (
     //
     *FullSmramRangeCount = SmramRangeCount + 1;
     Size = (*FullSmramRangeCount) * sizeof (EFI_SMRAM_DESCRIPTOR);
-    FullSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocatePool (Size);
+    FullSmramRanges = (EFI_SMRAM_DESCRIPTOR *) AllocateZeroPool (Size);
     ASSERT (FullSmramRanges != NULL);
 
     Status = mSmmAccess->GetCapabilities (mSmmAccess, &Size, FullSmramRanges); 
@@ -1406,7 +1406,7 @@ GetFullSmramRanges (
   // Sort the entries,
   // and reserve one entry for SMM Core in the full SMRAM ranges.
   //
-  FullSmramRanges = AllocatePool ((TempSmramRangeCount + 1) * sizeof 
(EFI_SMRAM_DESCRIPTOR));
+  FullSmramRanges = AllocateZeroPool ((TempSmramRangeCount + 1) * 
+ sizeof (EFI_SMRAM_DESCRIPTOR));
   ASSERT (FullSmramRanges != NULL);
   *FullSmramRangeCount = 0;
   do {
--
1.9.5.msysgit.0

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to