[PATCH] efi_loader: fix iteration of FMP protocols

Ilias Apalodimas ilias.apalodimas at linaro.org
Fri Dec 15 11:06:43 CET 2023


Hi Kojima-san

On Fri, 8 Dec 2023 at 07:40, Masahisa Kojima <masahisa.kojima at linaro.org> wrote:
>
> If one of the FMP protocols fails when calling GetImageInfo(),
> populating the ESRT ends up with failure and other FMP protocols
> are not added to the ESRT. We should still add all other FMP
> protocols to the ESRT.
>
> With this commit, iteration of all FMP protocols continues
> even though one of the FMP protocols fails.
>
> Signed-off-by: Masahisa Kojima <masahisa.kojima at linaro.org>
> ---
> Note that this patch addresses the following issue.
> https://source.denx.de/u-boot/custodians/u-boot-efi/-/issues/3

[...]

>
> @@ -381,14 +381,14 @@ efi_status_t efi_esrt_populate(void)
>                          */
>                         EFI_PRINT("ESRT erroneous FMP implementation\n");
>                         ret = EFI_INVALID_PARAMETER;
> -                       goto out;
> +                       continue;

This doesn't look correct now.  We set ret but we never exit to do
something with it, instead the result is overwritten on the next
iteration. I think we should only get rid of the assignment, unless I
am missing something

>                 }
>
>                 ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,

[...]

Thanks
/Ilias


More information about the U-Boot mailing list