summaryrefslogtreecommitdiff
path: root/firmware/lib
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-08-01 13:36:44 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-06 06:07:01 +0000
commit9c906110972f538ee5753845916ebd1f826f54b6 (patch)
tree733c4d13b29a827c45159969baf4daec5147a0e5 /firmware/lib
parent1db2f3801a8843a1d6380a0969d6836b41ca474e (diff)
downloadvboot-9c906110972f538ee5753845916ebd1f826f54b6.tar.gz
vboot/tpm: fix return type inconsistencies
TPM errors and vboot errors were getting mixed up. Note that this patch changes a function signature in the vboot1 API. Any callers of the function should be updated accordingly. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Idf332ca9ac61b5771fccf9e2ce75e8689c0aace9 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1730374 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1729712 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/lib')
-rw-r--r--firmware/lib/tpm2_lite/tlcl.c3
-rw-r--r--firmware/lib/tpm_lite/tlcl.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/firmware/lib/tpm2_lite/tlcl.c b/firmware/lib/tpm2_lite/tlcl.c
index 8705143a..9e6bc49f 100644
--- a/firmware/lib/tpm2_lite/tlcl.c
+++ b/firmware/lib/tpm2_lite/tlcl.c
@@ -38,7 +38,8 @@ static uint32_t tpm_get_response(TPM_CC command,
{
/* Command/response buffer. */
static uint8_t cr_buffer[TPM_BUFFER_SIZE];
- int out_size, res;
+ int out_size;
+ uint32_t res;
uint32_t in_size;
out_size = tpm_marshal_command(command, command_body,
diff --git a/firmware/lib/tpm_lite/tlcl.c b/firmware/lib/tpm_lite/tlcl.c
index 41f7cad9..fac992f9 100644
--- a/firmware/lib/tpm_lite/tlcl.c
+++ b/firmware/lib/tpm_lite/tlcl.c
@@ -80,7 +80,7 @@ static uint32_t TlclSendReceiveNoRetry(const uint8_t* request,
result = VbExTpmSendReceive(request, TpmCommandSize(request),
response, &response_length);
- if (0 != result) {
+ if (TPM_SUCCESS != result) {
/* Communication with TPM failed, so response is garbage */
VB2_DEBUG("TPM: command 0x%x send/receive failed: 0x%x\n",
TpmCommandCode(request), result);