SecurityPkg OpalPasswordSmm: Fix S3 resume failure.

Changes includes:
1.Check SMM device list before update it to avoid duplicate creation.
2.Clean up the configuration buffer before use it in S3 resume phase.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
This commit is contained in:
Eric Dong
2016-10-11 16:00:21 +08:00
committed by Star Zeng
parent 19e3aa7a8a
commit 0acd8df45f
2 changed files with 76 additions and 21 deletions

View File

@@ -1691,6 +1691,14 @@ NvmeControllerInit (
Nvme->Cid[0] = 0;
Nvme->Cid[1] = 0;
Nvme->Pt[0] = 0;
Nvme->Pt[1] = 0;
ZeroMem ((VOID *)(UINTN)(&(Nvme->SqTdbl[0])), sizeof (NVME_SQTDBL) * NVME_MAX_IO_QUEUES);
ZeroMem ((VOID *)(UINTN)(&(Nvme->CqHdbl[0])), sizeof (NVME_CQHDBL) * NVME_MAX_IO_QUEUES);
ZeroMem ((VOID *)(UINTN)Nvme->BaseMem, NVME_MEM_MAX_SIZE);
Status = NvmeDisableController (Nvme);
if (EFI_ERROR(Status)) {
DEBUG ((DEBUG_ERROR, "NvmeDisableController fail, Status: %r\n", Status));