]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
bootmeth: pass size to efi_binary_run()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 22 Dec 2023 15:01:56 +0000 (16:01 +0100)
committerTom Rini <trini@konsulko.com>
Fri, 22 Dec 2023 15:36:50 +0000 (10:36 -0500)
If we call efi_binary_run() with size parameter set to zero, we get an error

     Not a PE-COFF file

Fill the missing value.

Fixes: 1373ffde52e1 ("Merge tag 'v2024.01-rc5' into next")
Fixes: 7017fc54a5bc ("bootmeth: use efi_loader interfaces instead of bootefi command")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
boot/bootmeth_efi.c

index 00060f7d25a571c91848b7b5073dfb2cd6434ea6..c4eb331d69e6f54d029fcc0657017331fff43330 100644 (file)
@@ -454,12 +454,12 @@ static int distro_efi_boot(struct udevice *dev, struct bootflow *bflow)
 
        if (bflow->flags & BOOTFLOWF_USE_BUILTIN_FDT) {
                log_debug("Booting with built-in fdt\n");
-               if (efi_binary_run(map_sysmem(kernel, 0), 0,
+               if (efi_binary_run(map_sysmem(kernel, 0), bflow->size,
                                   EFI_FDT_USE_INTERNAL))
                        return log_msg_ret("run", -EINVAL);
        } else {
                log_debug("Booting with external fdt\n");
-               if (efi_binary_run(map_sysmem(kernel, 0), 0,
+               if (efi_binary_run(map_sysmem(kernel, 0), bflow->size,
                                   map_sysmem(fdt, 0)))
                        return log_msg_ret("run", -EINVAL);
        }