Skip to content

Commit 9e8b395

Browse files
committed
tpm: do not ignore memblock_reserve return value
JIRA: https://issues.redhat.com/browse/RHEL-72764 Upstream Status: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git commit c33c28f Author: Gregory Price <gourry@gourry.net> Date: Fri Sep 13 19:19:52 2024 -0400 tpm: do not ignore memblock_reserve return value tpm code currently ignores a relevant failure case silently. Add an error to make this failure non-silent. Signed-off-by: Gregory Price <gourry@gourry.net> Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
1 parent c972c82 commit 9e8b395

File tree

1 file changed

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

1 file changed

+6
-1
lines changed

drivers/firmware/efi/tpm.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,12 @@ int __init efi_tpm_eventlog_init(void)
6161
}
6262

6363
tbl_size = sizeof(*log_tbl) + log_tbl->size;
64-
memblock_reserve(efi.tpm_log, tbl_size);
64+
if (memblock_reserve(efi.tpm_log, tbl_size)) {
65+
pr_err("TPM Event Log memblock reserve fails (0x%lx, 0x%x)\n",
66+
efi.tpm_log, tbl_size);
67+
ret = -ENOMEM;
68+
goto out;
69+
}
6570

6671
if (efi.tpm_final_log == EFI_INVALID_TABLE_ADDR) {
6772
pr_info("TPM Final Events table not present\n");

0 commit comments

Comments
 (0)