U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>,
	AKASHI Takahiro <akashi.tkhro@gmail.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Shantur Rathore <i@shantur.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH v3 11/19] bootmeth_efi: Check the filename-allocation in the network path
Date: Mon, 4 Nov 2024 22:42:25 +0100	[thread overview]
Message-ID: <113aa432-79b7-4920-9b76-cb3543186efd@gmx.de> (raw)
In-Reply-To: <20241104175110.1048449-12-sjg@chromium.org>

On 11/4/24 18:51, Simon Glass wrote:
> If the filename cannot be set we should give up. Add the missing error
> check.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> (no changes since v2)
>
> Changes in v2:
> - Change the tag to bootmeth_efi
>
>   boot/bootmeth_efi.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/boot/bootmeth_efi.c b/boot/bootmeth_efi.c
> index e8109e19bcb..1ff8788ebeb 100644
> --- a/boot/bootmeth_efi.c
> +++ b/boot/bootmeth_efi.c
> @@ -269,6 +269,8 @@ static int distro_efi_read_bootflow_net(struct bootflow *bflow)
>   	if (!bootfile_name)
>   		return log_msg_ret("bootfile_name", ret);
>   	bflow->fname = strdup(bootfile_name);
> +	if (!bflow->fname)
> +		return log_msg_ret("fi0", -ENOMEM);

How could we hope that a user understands a cryptic message
"fi0: returning err=-12"?

Please, write a message that is user readable.

log_err("Out of memory");

Best regards

Heinrich


>
>   	/* do the hideous EFI hack */
>   	efi_set_bootdev("Net", "", bflow->fname, map_sysmem(addr, 0),


  reply	other threads:[~2024-11-04 21:42 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-04 17:50 [PATCH v3 00/19] bootstd: Support recording images Simon Glass
2024-11-04 17:50 ` [PATCH v3 01/19] bootstd: Move bootflow-adding to bootstd Simon Glass
2024-11-04 22:02   ` Heinrich Schuchardt
2024-11-05 15:13     ` Simon Glass
2024-11-05 15:39       ` Tom Rini
2024-11-05 16:07         ` Simon Glass
2024-11-04 17:50 ` [PATCH v3 02/19] bootstd: Move bootflow-clearing " Simon Glass
2024-11-04 22:04   ` Heinrich Schuchardt
2024-11-04 17:50 ` [PATCH v3 03/19] bootstd: Add a function to get bootstd only if available Simon Glass
2024-11-04 17:50 ` [PATCH v3 04/19] bootstd: Drop the bootdev-specific list of bootflows Simon Glass
2024-11-04 17:50 ` [PATCH v3 05/19] bootstd: Move the bootflow list into an alist Simon Glass
2024-11-04 17:50 ` [PATCH v3 06/19] bootstd: Maintain a list of images Simon Glass
2024-11-04 17:50 ` [PATCH v3 07/19] bootstd: Update bootmeth_alloc_file() to record images Simon Glass
2024-11-04 17:50 ` [PATCH v3 08/19] boot: pxe: Drop the duplicate comment on get_pxe_file() Simon Glass
2024-11-04 17:51 ` [PATCH v3 09/19] bootmeth_efi: Simplify reading files by using the common function Simon Glass
2024-11-04 17:51 ` [PATCH v3 10/19] bootmeth: Update the read_file() method to include a type Simon Glass
2024-11-04 17:51 ` [PATCH v3 11/19] bootmeth_efi: Check the filename-allocation in the network path Simon Glass
2024-11-04 21:42   ` Heinrich Schuchardt [this message]
2024-11-15 23:19     ` Simon Glass
2024-11-04 17:51 ` [PATCH v3 12/19] boot: Update extlinux pxe_getfile_func() to include type Simon Glass
2024-11-04 17:51 ` [PATCH v3 13/19] boot: Update pxe bootmeth to record images Simon Glass
2024-11-04 17:51 ` [PATCH v3 14/19] Update bootmeth_alloc_other() " Simon Glass
2024-11-04 17:51 ` [PATCH v3 15/19] bootstd: Update cros bootmeth " Simon Glass
2024-11-04 17:51 ` [PATCH v3 16/19] bootstd: Add a simple command to list images Simon Glass
2024-11-04 17:51 ` [PATCH v3 17/19] bootstd: Export bootdev_get_from_blk() Simon Glass
2024-11-04 17:51 ` [PATCH v3 18/19] bootstd: Add the concept of an ad-hoc bootflow Simon Glass
2024-11-04 17:51 ` [PATCH v3 19/19] fs: Record loaded files in " Simon Glass
2025-01-15 13:55 ` [PATCH v3 00/19] bootstd: Support recording images Simon Glass
2025-01-15 21:24   ` Tom Rini
2025-01-15 23:14     ` Simon Glass
2025-01-15 23:31       ` Tom Rini
2025-01-16 15:52         ` Simon Glass
2025-01-16 17:21           ` Tom Rini
2025-01-18  4:32             ` Simon Glass
2025-01-18  5:49               ` Tony Dinh
2025-01-18 14:41                 ` Tom Rini
2025-01-18 19:26                   ` Tony Dinh
2025-01-23 14:38                   ` Simon Glass
2025-01-23 17:17                     ` Tom Rini
2025-01-25 17:13                       ` Simon Glass
2025-01-25 18:27                         ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=113aa432-79b7-4920-9b76-cb3543186efd@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=akashi.tkhro@gmail.com \
    --cc=i@shantur.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=mkorpershoek@baylibre.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox