efi/tpm: Fix sanity check of unsigned tbl_size being less than zero
authorColin Ian King <colin.king@canonical.com>
Tue, 8 Oct 2019 10:01:53 +0000 (11:01 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 8 Oct 2019 11:01:09 +0000 (13:01 +0200)
commitbe59d57f98065af0b8472f66a0a969207b168680
tree059ab0079c0bf54693999e8016d82b03ef52577b
parent2ecb7402cfc7f22764e7bbc80790e66eadb20560
efi/tpm: Fix sanity check of unsigned tbl_size being less than zero

Currently the check for tbl_size being less than zero is always false
because tbl_size is unsigned. Fix this by making it a signed int.

Addresses-Coverity: ("Unsigned compared against 0")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jerry Snitselaar <jsnitsel@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: kernel-janitors@vger.kernel.org
Cc: linux-efi@vger.kernel.org
Fixes: e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing")
Link: https://lkml.kernel.org/r/20191008100153.8499-1-colin.king@canonical.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
drivers/firmware/efi/tpm.c