[PATCH v3 4/4] bootflow: bootmeth_efi: don't free buffer

Simon Glass sjg at chromium.org
Sun Nov 19 01:43:09 CET 2023


Hi Shantur,

On Sat, 18 Nov 2023 at 15:07, Shantur Rathore <i at shantur.com> wrote:
>
> bootmeth_efi doesn't allocate any buffer to load efi in any case.
> enable static buffer flag for all cases.
>
> Signed-off-by: Shantur Rathore <i at shantur.com>
> ---
>  boot/bootmeth_efi.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)

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

>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index 370d6fba9f..93f096896c 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -160,7 +160,6 @@ static int efiload_read_file(struct bootflow *bflow, ulong addr)
>         if (ret)
>                 return log_msg_ret("read", ret);
>         bflow->buf = map_sysmem(addr, bflow->size);
> -       bflow->flags |= BOOTFLOWF_STATIC_BUF;
>
>         set_efi_bootdev(desc, bflow);
>
> @@ -404,6 +403,12 @@ static int distro_efi_read_bootflow(struct udevice *dev, struct bootflow *bflow)
>  {
>         int ret;
>
> +       /*
> +        * bootmeth_efi doesn't allocate any buffer neither for bulk nor net device

s/bulk/blk/ ?

> +        * set flag to avoid freeing static buffer.
> +        */
> +       bflow->flags |= BOOTFLOWF_STATIC_BUF;
> +
>         if (bootmeth_uses_network(bflow)) {
>                 /* we only support reading from one device, so ignore 'dev' */
>                 ret = distro_efi_read_bootflow_net(bflow);
> --
> 2.40.1
>

Regards,
Simon


More information about the U-Boot mailing list