]> git.proxmox.com Git - mirror_edk2.git/commitdiff
StandaloneMmPkg: Fix ECC error 5007 in StandaloneMmCpu
authorSami Mujawar <sami.mujawar@arm.com>
Thu, 3 Dec 2020 20:22:22 +0000 (20:22 +0000)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Thu, 7 Jan 2021 11:13:39 +0000 (11:13 +0000)
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 <sami.mujawar@arm.com>
Acked-by: Jiewen Yao <Jiewen.yao@intel.com>
Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c

index 20877480535c66761ba2420f9b3fbd8a709c2155..2313d3f9b310c559c907a25d60f3592ca733f82e 100644 (file)
@@ -65,8 +65,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
   IN UINTN NsCommBufferAddr\r
   )\r
 {\r
   IN UINTN NsCommBufferAddr\r
   )\r
 {\r
-  EFI_MM_COMMUNICATE_HEADER *GuidedEventContext = NULL;\r
-  EFI_MM_ENTRY_CONTEXT        MmEntryPointContext = {0};\r
+  EFI_MM_COMMUNICATE_HEADER   *GuidedEventContext;\r
+  EFI_MM_ENTRY_CONTEXT        MmEntryPointContext;\r
   EFI_STATUS                  Status;\r
   UINTN                       NsCommBufferSize;\r
 \r
   EFI_STATUS                  Status;\r
   UINTN                       NsCommBufferSize;\r
 \r
@@ -107,6 +107,7 @@ PiMmStandaloneArmTfCpuDriverEntry (
     return EFI_ACCESS_DENIED;\r
   }\r
 \r
     return EFI_ACCESS_DENIED;\r
   }\r
 \r
+  GuidedEventContext = NULL;\r
   // Now that the secure world can see the normal world buffer, allocate\r
   // memory to copy the communication buffer to the secure world.\r
   Status = mMmst->MmAllocatePool (\r
   // Now that the secure world can see the normal world buffer, allocate\r
   // memory to copy the communication buffer to the secure world.\r
   Status = mMmst->MmAllocatePool (\r
@@ -127,6 +128,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
   // Stash the pointer to the allocated Event Context for this CPU\r
   PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext;\r
 \r
   // Stash the pointer to the allocated Event Context for this CPU\r
   PerCpuGuidedEventContext[CpuNumber] = GuidedEventContext;\r
 \r
+  ZeroMem (&MmEntryPointContext, sizeof (EFI_MM_ENTRY_CONTEXT));\r
+\r
   MmEntryPointContext.CurrentlyExecutingCpu = CpuNumber;\r
   MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors;\r
 \r
   MmEntryPointContext.CurrentlyExecutingCpu = CpuNumber;\r
   MmEntryPointContext.NumberOfCpus = mMpInformationHobData->NumberOfProcessors;\r
 \r