From: Eric Dong Date: Tue, 10 Jul 2018 02:24:30 +0000 (+0800) Subject: SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error. X-Git-Tag: edk2-stable201903~1433 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=54ae532cd4fded97a2a9f55eb87fab86063a0f07;hp=9edba51f93d8e81e09f905afc994efe02dbe524e SecurityPkg/TcgStorageOpalLib: Return AUTHORITY_LOCKED_OUT error. Caller need to known this error to handle specially, but current error status not has specified value for this type. In order to keep compatibility, here use TcgResultFailureInvalidType as an replacement. Cc: Hao Wu Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong Reviewed-by: Hao Wu --- diff --git a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c index ca8e7fbbdf..3c4a8e9001 100644 --- a/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c +++ b/SecurityPkg/Library/TcgStorageOpalLib/TcgStorageOpalUtil.c @@ -788,7 +788,15 @@ OpalUtilUpdateGlobalLockingRange( done: if (MethodStatus != TCG_METHOD_STATUS_CODE_SUCCESS) { - Ret = TcgResultFailure; + if (MethodStatus == TCG_METHOD_STATUS_CODE_AUTHORITY_LOCKED_OUT) { + // + // Caller need to know this special error, but return status not has type for it. + // so here use TcgResultFailureInvalidType as an replacement. + // + Ret = TcgResultFailureInvalidType; + } else { + Ret = TcgResultFailure; + } } return Ret; }