Code initialized in function can't be correctly detected by build tool.
Add code to clearly initialize the local variable before use it.

Cc: Ruiyu Ni <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Dandan Bi <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Eric Dong <[email protected]>
---
 UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c 
b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
index 5193fea2b3..a45e2dd3d7 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
@@ -451,6 +451,7 @@ SetRegister (
 
   InitApicId = GetInitialApicId ();
   RegisterTable = NULL;
+  ProcIndex = (UINTN)-1;
   for (Index = 0; Index < mAcpiCpuData.NumberOfCpus; Index++) {
     if (RegisterTables[Index].InitialApicId == InitApicId) {
       RegisterTable = &RegisterTables[Index];
-- 
2.15.0.windows.1

_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to