[PATCH] efi_loader: fix iteration of FMP protocols

Masahisa Kojima masahisa.kojima at linaro.org
Mon Dec 18 07:06:29 CET 2023


On Fri, 15 Dec 2023 at 19:07, Ilias Apalodimas
<ilias.apalodimas at linaro.org> wrote:
>
> 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

Yes, we need to remove "ret = EFI_INVALID_PARAMETER;" line.

Thanks,
Masahisa Kojima

>
> >                 }
> >
> >                 ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, info_size,
>
> [...]
>
> Thanks
> /Ilias


More information about the U-Boot mailing list