From: Kevin O'Connor Date: Wed, 10 Aug 2016 20:23:02 +0000 (-0400) Subject: tpm: Don't call tpm_set_failure() from tpm12_get_capability() X-Git-Tag: rel-1.11.0~73 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=d468d595a43ab91c00e064e06683f4c75f52a88e;p=people%2Fandrewcoop%2Fseabios.git tpm: Don't call tpm_set_failure() from tpm12_get_capability() 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 --- 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);