summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2016-07-15 04:51:45 -0700
committerMartin Roth <martinroth@google.com>2016-07-20 17:08:52 +0200
commited75b279a334e3a2c41ef179d7f4dbb8200445fb (patch)
tree10c9387dd07faef85eeaee0afc36b6182b0c32c0 /src/lib
parentb0672402ecedc7c8ca2e634437c603d73aebf471 (diff)
downloadcoreboot-ed75b279a334e3a2c41ef179d7f4dbb8200445fb.tar.gz
coreboot-ed75b279a334e3a2c41ef179d7f4dbb8200445fb.tar.bz2
coreboot-ed75b279a334e3a2c41ef179d7f4dbb8200445fb.zip
tpm2_tlcl: Use signed integer for tpm2_marshal_command return value
The tpm2_marshal_command() function returns a negative value on error, so we must use a signed type for the return value. This was found by the coverity scan: https://scan.coverity.com/projects/coreboot?tab=overview CID:1357675 CID:1357676 Change-Id: I56d2ce7d52b9b70e43378c13c66b55ac2948f218 Signed-off-by: Duncan Laurie <dlaurie@google.com> Found-by: Coverity Scan Reviewed-on: https://review.coreboot.org/15717 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/tpm2_tlcl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/tpm2_tlcl.c b/src/lib/tpm2_tlcl.c
index d9f9d37533b4..4ac112a067dc 100644
--- a/src/lib/tpm2_tlcl.c
+++ b/src/lib/tpm2_tlcl.c
@@ -21,7 +21,8 @@
static void *tpm_process_command(TPM_CC command, void *command_body)
{
- size_t out_size, in_size;
+ ssize_t out_size;
+ size_t in_size;
/* Command/response buffer. */
static uint8_t cr_buffer[TPM_BUFFER_SIZE];