audk/MdeModulePkg
Hao Wu 4fa7306bf5 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>
2019-02-22 08:20:08 +08:00
..
Application MdeModulePkg/CapsuleApp: Fix memory leak issue. 2019-02-13 16:25:47 +08:00
Bus MdeModulePkg/AhciPei: Add AHCI mode ATA device support in PEI 2019-02-22 08:20:08 +08:00
Core MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI 2019-02-15 13:40:30 +08:00
Include MdeModulePkg: Add GUID for LockBox to save storage dev to init in S3 2019-02-22 08:20:07 +08:00
Library MdeModulePkg/SmmLockBox(PEI): Remove an ASSERT in RestoreLockBox() 2019-02-22 08:20:08 +08:00
Logo MdeModulePkg: Removing ipf which is no longer supported from edk2. 2018-09-06 15:25:16 +08:00
Universal MdeModulePkg: Remove EmuVariableRuntimeDxe 2019-02-19 17:36:11 +08:00
MdeModulePkg.dec MdeModulePkg: Add GUID for LockBox to save storage dev to init in S3 2019-02-22 08:20:07 +08:00
MdeModulePkg.dsc MdeModulePkg/AhciPei: Add AHCI mode ATA device support in PEI 2019-02-22 08:20:08 +08:00
MdeModulePkg.uni MdeModulePkg: Refine description a little for PcdEmuVariableNvStoreReserved 2019-01-24 10:52:36 +08:00
MdeModulePkgExtra.uni MdeModulePkg: Clean up source files 2018-06-28 11:19:45 +08:00