diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c b/SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c index 46311bd8a0..47b570f343 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordSmm/OpalPasswordSmm.c @@ -442,19 +442,19 @@ SmmUnlockOpalPassword ( Session.MediaId = 0; Session.OpalBaseComId = OpalDev->OpalBaseComId; - if (mSendBlockSID && BlockSidSupport) { - Result = OpalBlockSid (&Session, TRUE); - if (Result != TcgResultSuccess) { - break; - } - } - Result = OpalSupportUnlock (&Session, OpalDev->Password, OpalDev->PasswordLength, NULL); if (Result == TcgResultSuccess) { Status = EFI_SUCCESS; } } + if (mSendBlockSID && BlockSidSupport) { + Result = OpalBlockSid (&Session, TRUE); + if (Result != TcgResultSuccess) { + break; + } + } + if (OpalDev->DeviceType == OPAL_DEVICE_TYPE_NVME) { if (SubClassCode == PCI_CLASS_MASS_STORAGE_NVM) { Status = NvmeControllerExit (&mNvmeContext);