]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c
ArmPkg/ArmMmuLib ARM: fix thinko in second level page table handling
[mirror_edk2.git] / SecurityPkg / Library / TcgStorageOpalLib / TcgStorageOpalUtil.c
index ca8e7fbbdf1f00ece8efe743d62192f6f738dccd..f2febc0a0cd19af923dfb4a5fc5868789a6438a5 100644 (file)
@@ -763,7 +763,6 @@ OpalUtilUpdateGlobalLockingRange(
 \r
   if (MethodStatus == TCG_METHOD_STATUS_CODE_AUTHORITY_LOCKED_OUT) {\r
     DEBUG ((DEBUG_INFO, "unlock as admin failed with AUTHORITY_LOCKED_OUT\n"));\r
-    goto done;\r
   }\r
 \r
   //\r
@@ -788,7 +787,15 @@ OpalUtilUpdateGlobalLockingRange(
 \r
 done:\r
   if (MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) {\r
-    Ret = TcgResultFailure;\r
+    if (MethodStatus == TCG_METHOD_STATUS_CODE_AUTHORITY_LOCKED_OUT) {\r
+      //\r
+      // Caller need to know this special error, but return status not has type for it.\r
+      // so here use TcgResultFailureInvalidType as an replacement.\r
+      //\r
+      Ret = TcgResultFailureInvalidType;\r
+    } else {\r
+      Ret = TcgResultFailure;\r
+    }\r
   }\r
   return Ret;\r
 }\r