summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/Tcg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-03-13 15:41:41 +0800
committerStar Zeng <star.zeng@intel.com>2018-03-17 15:48:55 +0800
commite3df050e5127e9857f90f9322c7f2d0458518955 (patch)
tree064a1b6e80a9df7665b33d3b2ed6864b355b98b3 /SecurityPkg/Tcg
parent849c684b860dcfd4a4e3992ed95dc0fb1c2b406f (diff)
downloadedk2-e3df050e5127e9857f90f9322c7f2d0458518955.tar.gz
edk2-e3df050e5127e9857f90f9322c7f2d0458518955.tar.bz2
edk2-e3df050e5127e9857f90f9322c7f2d0458518955.zip
SecurityPkg OpalPasswordPei: Go next when AhciModeInitialize is failed
Go to next loop instead of going to unlock OPAL password when AhciModeInitialize is failed. It is just error handling. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
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);
}