SecurityPkg OpalPasswordPei: Go next when AhciModeInitialize is failed
authorStar Zeng <star.zeng@intel.com>
Tue, 13 Mar 2018 07:41:41 +0000 (15:41 +0800)
committerStar Zeng <star.zeng@intel.com>
Sat, 17 Mar 2018 07:48:55 +0000 (15:48 +0800)
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>
SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordPei.c

index 7f9e14f..b4b2d4b 100644 (file)
@@ -717,17 +717,16 @@ UnlockOpalPasswordAta (
       ASSERT_EFI_ERROR (Status);\r
       if (EFI_ERROR (Status)) {\r
         DEBUG ((DEBUG_ERROR, "%a() AhciModeInitialize() error, Status: %r\n", __FUNCTION__, Status));\r
+      } else {\r
+        OpalDev.Signature = OPAL_PEI_DEVICE_SIGNATURE;\r
+        OpalDev.Sscp.ReceiveData = SecurityReceiveData;\r
+        OpalDev.Sscp.SendData = SecuritySendData;\r
+        OpalDev.DeviceType = OPAL_DEVICE_TYPE_ATA;\r
+        OpalDev.Device = (OPAL_DEVICE_COMMON *) DevInfoAta;\r
+        OpalDev.Context = &AhciContext;\r
+\r
+        UnlockOpalPassword (&OpalDev);\r
       }\r
-\r
-      OpalDev.Signature = OPAL_PEI_DEVICE_SIGNATURE;\r
-      OpalDev.Sscp.ReceiveData = SecurityReceiveData;\r
-      OpalDev.Sscp.SendData = SecuritySendData;\r
-      OpalDev.DeviceType = OPAL_DEVICE_TYPE_ATA;\r
-      OpalDev.Device = (OPAL_DEVICE_COMMON *) DevInfoAta;\r
-      OpalDev.Context = &AhciContext;\r
-\r
-      UnlockOpalPassword (&OpalDev);\r
-\r
       AhciFreeResource (&AhciContext);\r
       PciWrite32 (PCI_LIB_ADDRESS (Bus, Device, Function, 0x24), AhciBar);\r
     }\r