From 54ae532cd4fded97a2a9f55eb87fab86063a0f07 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Tue, 10 Jul 2018 10:24:30 +0800 Subject: [PATCH] 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 --- .../Library/TcgStorageOpalLib/TcgStorageOpalUtil.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.39.2