aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIlias Apalodimas2023-11-07 13:31:34 +0200
committerHeinrich Schuchardt2023-11-20 19:06:22 +0100
commit229f9e77fe46efb2516b7cfdc60db1d92721eac5 (patch)
tree28be018a24b2b8b2f19749d91a8196c63408a740 /lib
parenta8062549d6ba81e41596adab83f80e8f819f491d (diff)
efi_loader: Correctly account the SCRTM event creation
The result of efi_append_scrtm_version() is overwritten before anyone checks its result. Check it and exit the function on failures Addresses-Coverity-ID: 467399 Code maintainability issues (UNUSED_VALUE) Fixes: commit 97707f12fdab ("tpm: Support boot measurements") Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_tcg2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index 2eaa12b83b1..463ea4c1541 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -944,8 +944,11 @@ static efi_status_t efi_init_event_log(void)
* Add SCRTM version to the log if previous firmmware
* doesn't pass an eventlog.
*/
- if (!elog.found)
+ if (!elog.found) {
ret = efi_append_scrtm_version(dev);
+ if (ret != EFI_SUCCESS)
+ goto free_pool;
+ }
ret = create_final_event();
if (ret != EFI_SUCCESS)