mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] efi: payload: handle NULL return from loadable_view for ramdisk
@ 2026-05-07 11:51 Ahmad Fatoum
  2026-05-11  7:22 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-05-07 11:51 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

loadable_view() can return NULL (distinct from ERR_PTR), which is not
caught by IS_ERR().

efi_load_os() already handles this with the ?: ERR_PTR(-ENODATA) pattern,
so apply the same to efi_load_ramdisk().

Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
 efi/payload/bootm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/efi/payload/bootm.c b/efi/payload/bootm.c
index 30b6fe8977e0..2f9cc3cbf76b 100644
--- a/efi/payload/bootm.c
+++ b/efi/payload/bootm.c
@@ -86,7 +86,7 @@ static int efi_load_ramdisk(struct image_data *data,
 	if (!data->initrd)
 		return 0;
 
-	initrd_mem = loadable_view(data->initrd, initrd_size);
+	initrd_mem = loadable_view(data->initrd, initrd_size) ?: ERR_PTR(-ENODATA);
 	if (IS_ERR(initrd_mem)) {
 		pr_err("Cannot open ramdisk image: %pe\n", initrd_mem);
 		return PTR_ERR(initrd_mem);
-- 
2.47.3




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] efi: payload: handle NULL return from loadable_view for ramdisk
  2026-05-07 11:51 [PATCH] efi: payload: handle NULL return from loadable_view for ramdisk Ahmad Fatoum
@ 2026-05-11  7:22 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-05-11  7:22 UTC (permalink / raw)
  To: barebox, Ahmad Fatoum


On Thu, 07 May 2026 13:51:12 +0200, Ahmad Fatoum wrote:
> loadable_view() can return NULL (distinct from ERR_PTR), which is not
> caught by IS_ERR().
> 
> efi_load_os() already handles this with the ?: ERR_PTR(-ENODATA) pattern,
> so apply the same to efi_load_ramdisk().
> 
> 
> [...]

Applied, thanks!

[1/1] efi: payload: handle NULL return from loadable_view for ramdisk
      https://git.pengutronix.de/cgit/barebox/commit/?id=43a16ebe7493 (link may not be stable)

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-05-11  7:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-07 11:51 [PATCH] efi: payload: handle NULL return from loadable_view for ramdisk Ahmad Fatoum
2026-05-11  7:22 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox