Skip to content

Commit be59d57

Browse files
Colin Ian KingIngo Molnar
authored andcommitted
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 <[email protected]> Cc: Ard Biesheuvel <[email protected]> Cc: Jerry Snitselaar <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Cc: [email protected] Fixes: e658c82 ("efi/tpm: Only set 'efi_tpm_final_log_size' after successful event log parsing") Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 2ecb740 commit be59d57

File tree

1 file changed

+1
-1
lines changed
  • drivers/firmware/efi

1 file changed

+1
-1
lines changed

drivers/firmware/efi/tpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int __init efi_tpm_eventlog_init(void)
4040
{
4141
struct linux_efi_tpm_eventlog *log_tbl;
4242
struct efi_tcg2_final_events_table *final_tbl;
43-
unsigned int tbl_size;
43+
int tbl_size;
4444
int ret = 0;
4545

4646
if (efi.tpm_log == EFI_INVALID_TABLE_ADDR) {

0 commit comments

Comments
 (0)