From 48a83481d2a2df7ec59061ff9ef262109948b724 Mon Sep 17 00:00:00 2001 From: Tom Lendacky Date: Thu, 20 Aug 2020 09:53:19 -0500 Subject: [PATCH] UefiCpuPkg/MpInitLib: Always initialize the DoDecrement variable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2901 The DoDecrement variable in ApWakeupFunction () wasn't always being initialized. Update the code to always fully initialize it. Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Rahul Kumar Signed-off-by: Tom Lendacky Message-Id: <76a9f18992475b915e5f8457704676067210cacf.1597935198.git.thomas.lendacky@amd.com> Reviewed-by: Eric Dong Tested-by: Liming Gao Reviewed-by: Laszlo Ersek --- UefiCpuPkg/Library/MpInitLib/MpLib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 90416c81b616..07426274f639 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -885,9 +885,7 @@ ApWakeupFunction ( UINT64 Status; BOOLEAN DoDecrement; - if (CpuMpData->InitFlag == ApInitConfig) { - DoDecrement = TRUE; - } + DoDecrement = (BOOLEAN) (CpuMpData->InitFlag == ApInitConfig); while (TRUE) { Msr.GhcbPhysicalAddress = AsmReadMsr64 (MSR_SEV_ES_GHCB);