cpu/x86/smm: Fix smm_get_save_state() returning invalid pointer
The smm_get_save_state() function returns an invalid pointer (negative
pointer) when the cpu variable is equal to the number of CPUs. This
leads to a hang when the pointer is used to access the save state.
TEST=No unexpected hangs in System Management Mode (SMM) were detected
on fatcat.
Change-Id: I09f969105190a004372c43cb1542f5b716da1eda
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/86038
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Jamie Ryu <jamie.m.ryu@intel.com>
This commit is contained in:
parent
54673dffb7
commit
0cf6a4d702
1 changed files with 1 additions and 1 deletions
|
|
@ -106,7 +106,7 @@ struct global_nvs *gnvs;
|
|||
|
||||
void *smm_get_save_state(int cpu)
|
||||
{
|
||||
if (cpu > smm_runtime.num_cpus)
|
||||
if (cpu >= smm_runtime.num_cpus)
|
||||
return NULL;
|
||||
|
||||
return (void *)(smm_runtime.save_state_top[cpu] -
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue