summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/tpm2_tlcl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/tpm2_tlcl.c b/src/lib/tpm2_tlcl.c
index ec20ca9446..312fe36414 100644
--- a/src/lib/tpm2_tlcl.c
+++ b/src/lib/tpm2_tlcl.c
@@ -246,13 +246,13 @@ uint32_t tlcl_write(uint32_t index, const void *data, uint32_t length)
response = tpm_process_command(TPM2_NV_Write, &nv_writec);
+ printk(BIOS_INFO, "%s: response is %x\n",
+ __func__, response ? response->hdr.tpm_code : -1);
+
/* Need to map tpm error codes into internal values. */
- if (!response)
+ if (!response || response->hdr.tpm_code)
return TPM_E_WRITE_FAILURE;
- printk(BIOS_INFO, "%s:%d return code %x\n", __func__, __LINE__,
- response->hdr.tpm_code);
-
return TPM_SUCCESS;
}