summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2018-10-25 10:12:52 +0800
committerEric Dong <eric.dong@intel.com>2018-10-26 11:28:37 +0800
commit7db4034f9ac578f1d834ff5ad062b8982ec81137 (patch)
tree3a3aa2d9f923d52ffbf147e16d5067a51d32ec75
parent31fb333431da1dfdd49ed4e12a7866e467a17030 (diff)
downloadedk2-7db4034f9ac578f1d834ff5ad062b8982ec81137.tar.gz
edk2-7db4034f9ac578f1d834ff5ad062b8982ec81137.tar.xz
edk2-7db4034f9ac578f1d834ff5ad062b8982ec81137.zip
UefiCpuPkg/PiSmmCpuDxeSmm: Fix build failure for VS2012 and GCC49.
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 <ruiyu.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Dandan Bi <dandan.bi@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c1
1 files changed, 1 insertions, 0 deletions
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];