* [PATCH] tpm: efi: Improve exception handling in tpm_read_log_efi()
@ 2025-03-09 13:50 Markus Elfring
0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-03-09 13:50 UTC (permalink / raw)
To: linux-integrity, Jarkko Sakkinen, Jason Gunthorpe, Peter Hüwe; +Cc: LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 9 Mar 2025 14:43:52 +0100
Add a label so that a bit of exception handling can be better reused
from an if branch in this function implementation.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/char/tpm/eventlog/efi.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/char/tpm/eventlog/efi.c b/drivers/char/tpm/eventlog/efi.c
index 4e9d7c2bf32e..472292e9d52d 100644
--- a/drivers/char/tpm/eventlog/efi.c
+++ b/drivers/char/tpm/eventlog/efi.c
@@ -77,9 +77,7 @@ int tpm_read_log_efi(struct tpm_chip *chip)
MEMREMAP_WB);
if (!final_tbl) {
pr_err("Could not map UEFI TPM final log\n");
- devm_kfree(&chip->dev, log->bios_event_log);
- ret = -ENOMEM;
- goto out;
+ goto free_log;
}
/*
@@ -96,6 +94,7 @@ int tpm_read_log_efi(struct tpm_chip *chip)
log_size + final_events_log_size,
GFP_KERNEL);
if (!tmp) {
+free_log:
devm_kfree(&chip->dev, log->bios_event_log);
ret = -ENOMEM;
goto out;
--
2.48.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2025-03-09 13:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-09 13:50 [PATCH] tpm: efi: Improve exception handling in tpm_read_log_efi() Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®