]> xenbits.xensource.com Git - seabios.git/commitdiff
tpm: Don't call tpm_set_failure() from tpm12_get_capability()
authorKevin O'Connor <kevin@koconnor.net>
Wed, 10 Aug 2016 20:23:02 +0000 (16:23 -0400)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 27 Nov 2016 20:04:48 +0000 (15:04 -0500)
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@koconnor.net>
src/tcgbios.c

index 4cff4cefec14e791586040447999520a6701dc60..a3ee37cd02eaf46767963d8b6633cf252d576dbf 100644 (file)
@@ -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);