summaryrefslogtreecommitdiffstats
path: root/drivers/char/tpm/eventlog/efi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/tpm/eventlog/efi.c')
-rw-r--r--drivers/char/tpm/eventlog/efi.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/tpm/eventlog/efi.c b/drivers/char/tpm/eventlog/efi.c
index 6bb023de17f1..35229e5143ca 100644
--- a/drivers/char/tpm/eventlog/efi.c
+++ b/drivers/char/tpm/eventlog/efi.c
@@ -41,6 +41,11 @@ int tpm_read_log_efi(struct tpm_chip *chip)
log_size = log_tbl->size;
memunmap(log_tbl);
+ if (!log_size) {
+ pr_warn("UEFI TPM log area empty\n");
+ return -EIO;
+ }
+
log_tbl = memremap(efi.tpm_log, sizeof(*log_tbl) + log_size,
MEMREMAP_WB);
if (!log_tbl) {