mirror of https://github.com/acidanthera/audk.git
MdeModulePkg DxeS3BootScriptLib: Check (mSmst != NULL) before freeing SMRAM
There is static scan tool reports BootScriptSave.c:628:'mSmst' is explicitly dereferenced. The patch is to check (mSmst != NULL) before freeing SMRAM at BootScriptSave.c:628. Cc: Shumin Qiu <shumin.qiu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
This commit is contained in:
parent
3900a7437e
commit
d6f38e374e
|
@ -624,7 +624,7 @@ S3BootScriptLibDeinitialize (
|
|||
Status = PcdSet64S (PcdS3BootScriptTablePrivateDataPtr, 0);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
if (mS3BootScriptTableSmmAllocated) {
|
||||
if ((mSmst != NULL) && mS3BootScriptTableSmmAllocated) {
|
||||
Status = mSmst->SmmFreePool (mS3BootScriptTableSmmPtr);
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
Status = PcdSet64S (PcdS3BootScriptTablePrivateSmmDataPtr, 0);
|
||||
|
|
Loading…
Reference in New Issue