aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-08-10 16:23:02 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-11-27 15:04:48 -0500
commitd468d595a43ab91c00e064e06683f4c75f52a88e (patch)
tree3e6c2d6233fa34fbd788845ae4f30ecb56da8f9f
parent2f975709df602f0fb940355bea0853243fb8c08b (diff)
downloadseabios-d468d595a43ab91c00e064e06683f4c75f52a88e.tar.gz
seabios-d468d595a43ab91c00e064e06683f4c75f52a88e.tar.xz
seabios-d468d595a43ab91c00e064e06683f4c75f52a88e.zip
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 <kevin@koconnor.net>
-rw-r--r--src/tcgbios.c6
1 files changed, 1 insertions, 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);