mirror of https://github.com/acidanthera/audk.git
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>
This commit is contained in:
parent
ab3f3d7027
commit
c9b094f610
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue