]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: Correctly account the SCRTM event creation
authorIlias Apalodimas <ilias.apalodimas@linaro.org>
Tue, 7 Nov 2023 11:31:34 +0000 (13:31 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 20 Nov 2023 18:06:22 +0000 (19:06 +0100)
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>
lib/efi_loader/efi_tcg2.c

index 2eaa12b83b1661bbda498b886f62a11f5c4b23e0..463ea4c1541679aa88088d3fdb17f2b8c70dc276 100644 (file)
@@ -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)