summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Library
diff options
context:
space:
mode:
authorHao Wu <hao.a.wu@intel.com>2018-12-24 14:49:01 +0800
committerHao Wu <hao.a.wu@intel.com>2019-02-22 08:20:08 +0800
commit4fa7306bf5cd46aa8f98331de4c364c4a5380384 (patch)
treef00d001d38649b9b2214d3dfad689cc3bda36bb7 /MdeModulePkg/Library
parent481ffd6f7604bc033282decf8fc964edb1bb31bc (diff)
downloadedk2-4fa7306bf5cd46aa8f98331de4c364c4a5380384.tar.gz
edk2-4fa7306bf5cd46aa8f98331de4c364c4a5380384.tar.bz2
edk2-4fa7306bf5cd46aa8f98331de4c364c4a5380384.zip
MdeModulePkg/SmmLockBox(PEI): Remove an ASSERT in RestoreLockBox()
This commit is out of the scope for BZ-1409. It is a refinement for the PEI library instance within SmmLockBoxLib. For the below ASSERT statement within function RestoreLockBox(): Status = SmmCommunicationPpi->Communicate ( SmmCommunicationPpi, &CommBuffer[0], &CommSize ); if (Status == EFI_NOT_STARTED) { // // Pei SMM communication not ready yet, so we access SMRAM directly // DEBUG ((DEBUG_INFO, "SmmLockBoxPeiLib Communicate - (%r)\n", Status)); Status = InternalRestoreLockBoxFromSmram (Guid, Buffer, Length); LockBoxParameterRestore->Header.ReturnStatus = (UINT64)Status; if (Length != NULL) { LockBoxParameterRestore->Length = (UINT64)*Length; } } ASSERT_EFI_ERROR (Status); It is possible for previous codes to return an error status that is possible for happen. One example is that, when the 'if' statement 'if (Status == EFI_NOT_STARTED) {' is entered, function InternalRestoreLockBoxFromSmram() is possible to return 'BUFFER_TOO_SMALL' if the caller of RestoreLockBox() provides a buffer that is too small to hold the content of LockBox. Thus, this commit will remove the ASSERT here. Please note that the current implementation of RestoreLockBox() is handling the above-mentioned error case properly, so no additional error handling codes are needed here. Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
Diffstat (limited to 'MdeModulePkg/Library')
-rw-r--r--MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
index 9f73480070..8c3e65bc96 100644
--- a/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
+++ b/MdeModulePkg/Library/SmmLockBoxLib/SmmLockBoxPeiLib.c
@@ -623,7 +623,6 @@ RestoreLockBox (
LockBoxParameterRestore->Length = (UINT64)*Length;
}
}
- ASSERT_EFI_ERROR (Status);
if (Length != NULL) {
*Length = (UINTN)LockBoxParameterRestore->Length;