[PATCH 2/2] efi_loader: centralize messaging for efi_init_obj_list

Simon Glass sjg at chromium.org
Mon Apr 20 21:33:02 CEST 2026


Hi Heinrich,

On 2026-04-18T17:58:12, Heinrich Schuchardt
<heinrich.schuchardt at canonical.com> wrote:
> efi_loader: centralize messaging for efi_init_obj_list
>
> If efi_init_obj_list() fails we cannot use the UEFI sub-system.
>
> * Instead of having messages for this everywhere write an error message
>   in efi_init_obj_list().
> * Always use (ret =! EFI_SUCCESS) when checking the return value of

should be !=

>   efi_init_obj_list().
> * Remove the return code from the error message as it does not help
>   users to understand which initialization went wrong.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt at canonical.com>
>
> boot/bootmeth_efi_mgr.c      |  4 ++--
>  cmd/bootefi.c                |  5 +----
>  cmd/bootmenu.c               |  6 +-----
>  cmd/eficonfig.c              |  6 +-----
>  cmd/efidebug.c               |  5 +----
>  cmd/nvedit_efi.c             | 10 ++--------
>  lib/efi_loader/efi_bootbin.c |  5 +----
>  lib/efi_loader/efi_bootmgr.c |  5 +----
>  lib/efi_loader/efi_setup.c   |  2 ++
>  9 files changed, 12 insertions(+), 36 deletions(-)

> diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> @@ -1310,11 +1310,8 @@ efi_status_t efi_bootmgr_run(void *fdt)
> +     if (ret != EFI_SUCCESS)
> +             return CMD_RET_FAILURE;

Pre-existing issue: efi_bootmgr_run() returns efi_status_t but
CMD_RET_FAILURE is 1 - since you are touching this code, please can
you fix it to return ret instead, if that is the intent?

> diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
> @@ -224,11 +224,8 @@ static efi_status_t efi_binary_run_dp(void *image, size_t size, void *fdt,
> +     if (ret != EFI_SUCCESS)
> +             return -1;

Similarly, efi_binary_run_dp() should return ret rather than -1

Reviewed-by: Simon Glass <sjg at chromium.org>

Regards,
Simon


More information about the U-Boot mailing list