Reviewed-by: Qiu Shumin <[email protected]> -----Original Message----- From: Zeng, Star Sent: Sunday, June 12, 2016 12:52 PM To: [email protected] Cc: Qiu, Shumin; Yao, Jiewen Subject: [PATCH] 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 <[email protected]> Cc: Jiewen Yao <[email protected]> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <[email protected]> --- MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c index f6de986e0852..0ff73211acc4 100644 --- a/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c +++ b/MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptSave.c @@ -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); -- 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

