summaryrefslogtreecommitdiffstats
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:51:20 +0800
commit5af1943160e78f525d04abc159d5befe0d05c1c8 (patch)
tree523373d37fd164c5c6a1e024a08033d7e12312fc
parentf4d825eb43ea107b46ee50c8bba590977dd93860 (diff)
downloadedk2-5af1943160e78f525d04abc159d5befe0d05c1c8.tar.gz
edk2-5af1943160e78f525d04abc159d5befe0d05c1c8.tar.bz2
edk2-5af1943160e78f525d04abc159d5befe0d05c1c8.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> (cherry picked from commit e3df050e5127e9857f90f9322c7f2d0458518955)
-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);
}