]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: simplify efi_tcg2_hash_log_extend_event()
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Tue, 5 Nov 2024 04:20:45 +0000 (05:20 +0100)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 23 Nov 2024 22:14:15 +0000 (23:14 +0100)
The value of variable nt is never used. Just use NULL when calling
efi_check_pe().

The API function is not expected to write to the console. Such output might
have unwanted side effects on the screen layout of an EFI application.

Leave error handling to the caller.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
lib/efi_loader/efi_tcg2.c

index 866a529857efd456633836828161f3eb6868c1f9..572c6b5bf6304f8cbed8e62a38af792b5b073f3f 100644 (file)
@@ -607,12 +607,9 @@ efi_tcg2_hash_log_extend_event(struct efi_tcg2_protocol *this, u64 flags,
         * Format"
         */
        if (flags & PE_COFF_IMAGE) {
-               IMAGE_NT_HEADERS32 *nt;
-
                ret = efi_check_pe((void *)(uintptr_t)data_to_hash,
-                                  data_to_hash_len, (void **)&nt);
+                                  data_to_hash_len, NULL);
                if (ret != EFI_SUCCESS) {
-                       log_err("Not a valid PE-COFF file\n");
                        ret = EFI_UNSUPPORTED;
                        goto out;
                }