diff options
author | Sami Mujawar <sami.mujawar@arm.com> | 2020-12-03 20:22:22 +0000 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-01-07 11:13:39 +0000 |
commit | eda1ffacf1b4aa2b466c5e30334eb88f7a23dcfc (patch) | |
tree | b0c1021273419200e5323a652c21b14a1b33bbb1 /StandaloneMmPkg | |
parent | 7aa9d75211fad45f6756b93fa2048b483deb0582 (diff) | |
download | edk2-eda1ffacf1b4aa2b466c5e30334eb88f7a23dcfc.tar.gz edk2-eda1ffacf1b4aa2b466c5e30334eb88f7a23dcfc.tar.bz2 edk2-eda1ffacf1b4aa2b466c5e30334eb88f7a23dcfc.zip |
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 <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>
Diffstat (limited to 'StandaloneMmPkg')
-rw-r--r-- | StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c | 7 |
1 files 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;
|