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>
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;
}
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);