[SeaBIOS] [PATCH 2/6] tpm: Don't call tpm_set_failure() from tpm12_get_capability()

Kevin O'Connor kevin at koconnor.net
Thu Aug 11 17:17:59 CEST 2016


In the event of a failure in the low-level tpm12_get_capability()
code, just return an error code.  The caller can shutdown the TPM if
needed - the only place where that is needed is during a failure in
tpm12_determine_timeouts().

Signed-off-by: Kevin O'Connor <kevin at koconnor.net>
---
 src/tcgbios.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/tcgbios.c b/src/tcgbios.c
index 4cff4ce..a3ee37c 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -502,10 +502,6 @@ tpm12_get_capability(u32 cap, u32 subcap, struct tpm_rsp_header *rsp, u32 rsize)
     ret = (ret || resp_size != rsize) ? -1 : be32_to_cpu(rsp->errcode);
     dprintf(DEBUG_tcg, "TCGBIOS: Return code from TPM_GetCapability(%d, %d)"
             " = %x\n", cap, subcap, ret);
-    if (ret) {
-        dprintf(DEBUG_tcg, "TCGBIOS: TPM malfunctioning (line %d).\n", __LINE__);
-        tpm_set_failure();
-    }
     return ret;
 }
 
@@ -846,7 +842,7 @@ tpm12_startup(void)
 
     ret = tpm12_determine_timeouts();
     if (ret)
-        return -1;
+        goto err_exit;
 
     ret = tpm_build_and_send_cmd(0, TPM_ORD_SelfTestFull, NULL, 0,
                                  TPM_DURATION_TYPE_LONG);
-- 
2.5.5




More information about the SeaBIOS mailing list