From 08308fc9eba9d0bc0d3a923df90a86b8521028d5 Mon Sep 17 00:00:00 2001 From: Star Zeng Date: Tue, 28 Jul 2015 02:07:06 +0000 Subject: MdeModulePkg PiSmmIpl: Use AllocateZeroPool() for FullSmramRanges to instead of AllocatePool() to ensure the data is clean for the following consumption. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Jiewen Yao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18087 6f19259b-4bc3-4df7-8a09-765794883524 --- 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 9b269779ea..c534ee3701 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 { -- cgit v1.2.3