diff mbox series

[2/5] efi/tpm: return -EINVAL when determining tpm final events log size fails

Message ID 20191023173201.6607-3-ard.biesheuvel@linaro.org
State New
Headers show
Series [1/5] efi: Make CONFIG_EFI_RCI2_TABLE selectable on x86 only | expand

Commit Message

Ard Biesheuvel Oct. 23, 2019, 5:31 p.m. UTC
From: Jerry Snitselaar <jsnitsel@redhat.com>


Currently nothing checks the return value of efi_tpm_eventlog_init,
but in case that changes in the future make sure an error is
returned when it fails to determine the tpm final events log
size.

Fixes: e658c82be556 ("efi/tpm: Only set 'efi_tpm_final_log_size' after ...")
Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com>

Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

---
 drivers/firmware/efi/tpm.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.17.1
diff mbox series

Patch

diff --git a/drivers/firmware/efi/tpm.c b/drivers/firmware/efi/tpm.c
index ebd7977653a8..31f9f0e369b9 100644
--- a/drivers/firmware/efi/tpm.c
+++ b/drivers/firmware/efi/tpm.c
@@ -88,6 +88,7 @@  int __init efi_tpm_eventlog_init(void)
 
 	if (tbl_size < 0) {
 		pr_err(FW_BUG "Failed to parse event in TPM Final Events Log\n");
+		ret = -EINVAL;
 		goto out_calc;
 	}