summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
diff options
context:
space:
mode:
authorEric Dong <eric.dong@intel.com>2017-10-09 13:23:27 +0800
committerEric Dong <eric.dong@intel.com>2017-10-09 14:52:46 +0800
commitc9b094f61029efff45c8d555d3eff6b061f77b8a (patch)
tree262d4ca8d0cafb9fa0794d6664a0a6d697574ac7 /UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
parentab3f3d7027483f030b92a665c92d5b07eeee2297 (diff)
downloadedk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.tar.gz
edk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.tar.bz2
edk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.zip
UefiCpuPkg/PiSmmCpuDxeSmm: Add check to void use null pointer.
Current code logic not check the pointer before use it. This may has potential issue, this patch add code to check it. Cc: Ruiyu Ni <ruiyu.ni@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> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
Diffstat (limited to 'UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c')
-rw-r--r--UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
index ef72b9b45d..94e5ab2c0e 100644
--- a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
+++ b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c
@@ -226,12 +226,14 @@ SetProcessorRegister (
CPU_REGISTER_TABLE *RegisterTable;
InitApicId = GetInitialApicId ();
+ RegisterTable = NULL;
for (Index = 0; Index < RegisterTableCount; Index++) {
if (RegisterTables[Index].InitialApicId == InitApicId) {
RegisterTable = &RegisterTables[Index];
break;
}
}
+ ASSERT (RegisterTable != NULL);
//
// Traverse Register Table of this logical processor