summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg
diff options
context:
space:
mode:
Diffstat (limited to 'SecurityPkg/Tcg')
-rw-r--r--SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
index 7f9e14fa81..b4b2d4b3f0 100644
--- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
+++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c
@@ -717,17 +717,16 @@ UnlockOpalPasswordAta (
ASSERT_EFI_ERROR (Status);
if (EFI_ERROR (Status)) {
DEBUG ((DEBUG_ERROR, "%a() AhciModeInitialize() error, Status: %r\n", __FUNCTION__, Status));
+ } else {
+ OpalDev.Signature = OPAL_PEI_DEVICE_SIGNATURE;
+ OpalDev.Sscp.ReceiveData = SecurityReceiveData;
+ OpalDev.Sscp.SendData = SecuritySendData;
+ OpalDev.DeviceType = OPAL_DEVICE_TYPE_ATA;
+ OpalDev.Device = (OPAL_DEVICE_COMMON *) DevInfoAta;
+ OpalDev.Context = &AhciContext;
+
+ UnlockOpalPassword (&OpalDev);
}
-
- OpalDev.Signature = OPAL_PEI_DEVICE_SIGNATURE;
- OpalDev.Sscp.ReceiveData = SecurityReceiveData;
- OpalDev.Sscp.SendData = SecuritySendData;
- OpalDev.DeviceType = OPAL_DEVICE_TYPE_ATA;
- OpalDev.Device = (OPAL_DEVICE_COMMON *) DevInfoAta;
- OpalDev.Context = &AhciContext;
-
- UnlockOpalPassword (&OpalDev);
-
AhciFreeResource (&AhciContext);
PciWrite32 (PCI_LIB_ADDRESS (Bus, Device, Function, 0x24), AhciBar);
}