From eda1ffacf1b4aa2b466c5e30334eb88f7a23dcfc Mon Sep 17 00:00:00 2001 From: Sami Mujawar Date: Thu, 3 Dec 2020 20:22:22 +0000 Subject: [PATCH] StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCpu Bugzilla: 3150 (https://bugzilla.tianocore.org/show_bug.cgi?id=3150) Fix ECC error "[5007] There should be no initialization of a variable as part of its declaration Variable." Signed-off-by: Sami Mujawar Acked-by: Jiewen Yao Acked-by: Ard Biesheuvel Reviewed-by: Liming Gao --- .../Drivers/StandaloneMmCpu/AArch64/EventHandle.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c index 2087748053..2313d3f9b3 100644 --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c @@ -65,8 +65,8 @@ PiMmStandaloneArmTfCpuDriverEntry ( IN UINTN NsCommBufferAddr ) { - EFI_MM_COMMUNICATE_HEADER *GuidedEventContext = NULL; - EFI_MM_ENTRY_CONTEXT MmEntryPointContext = {0}; + EFI_MM_COMMUNICATE_HEADER *GuidedEventContext; + EFI_MM_ENTRY_CONTEXT MmEntryPointContext; EFI_STATUS Status; UINTN NsCommBufferSize; @@ -107,6 +107,7 @@ PiMmStandaloneArmTfCpuDriverEntry ( return EFI_ACCESS_DENIED; } + GuidedEventContext = NULL; // Now that the secure world can see the normal world buffer, allocate // memory to copy the communication buffer to the secure world. Status = mMmst->MmAllocatePool ( @@ -127,6 +128,8 @@ PiMmStandaloneArmTfCpuDriverEntry ( // Stash the pointer to the allocated Event Context for this CPU PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext; + ZeroMem (&MmEntryPointContext, sizeof (EFI_MM_ENTRY_CONTEXT)); + MmEntryPointContext.CurrentlyExecutingCpu = CpuNumber; MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors; -- 2.39.2