diff options
author | Eric Dong <eric.dong@intel.com> | 2017-10-09 13:23:27 +0800 |
---|---|---|
committer | Eric Dong <eric.dong@intel.com> | 2017-10-09 14:52:46 +0800 |
commit | c9b094f61029efff45c8d555d3eff6b061f77b8a (patch) | |
tree | 262d4ca8d0cafb9fa0794d6664a0a6d697574ac7 /UefiCpuPkg | |
parent | ab3f3d7027483f030b92a665c92d5b07eeee2297 (diff) | |
download | edk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.zip edk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.tar.gz edk2-c9b094f61029efff45c8d555d3eff6b061f77b8a.tar.bz2 |
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')
-rw-r--r-- | UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c b/UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c index ef72b9b..94e5ab2 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
|