From: Ahmad Fatoum <a.fatoum@barebox.org>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH] ARM: bootm-fip: don't dereference a missing HW_CONFIG
Date: Wed, 25 Nov 2026 18:28:11 +0100 [thread overview]
Message-ID: <20261125172813.1511714-1-a.fatoum@barebox.org> (raw)
A FIP without a HW_CONFIG entry has no loadable for it, but the jump to
BL33 dereferences its start address unconditionally. The STM32MP FIPs
always have one.
Let's pass 0 when there's none, as the verbose print above already
allows for.
Fixes: c33636a0f165 ("ARM: add support for chainloading barebox inside FIP images")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
arch/arm/cpu/bootm-fip.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/arm/cpu/bootm-fip.c b/arch/arm/cpu/bootm-fip.c
index a4da4c538abe..beeae09f4066 100644
--- a/arch/arm/cpu/bootm-fip.c
+++ b/arch/arm/cpu/bootm-fip.c
@@ -194,6 +194,7 @@ static int do_bootm_fip(struct image_data *data)
struct fip_image_desc *loadables[IMAGE_COUNT] = {};
struct fip_image_desc *desc;
struct fip_state *fip;
+ phys_addr_t hw_config = 0;
int ret;
if (!data->os_file)
@@ -239,13 +240,16 @@ static int do_bootm_fip(struct image_data *data)
goto out;
}
+ if (loadables[IMAGE_HW_CONFIG])
+ hw_config = desc_get_res(loadables[IMAGE_HW_CONFIG])->start;
+
shutdown_barebox();
/* We don't actually expect NT FW to be a Linux image, but
* we want to use the Linux boot calling convention
*/
jump_to_linux((void *)desc_get_res(loadables[IMAGE_BL33])->start,
- desc_get_res(loadables[IMAGE_HW_CONFIG])->start);
+ hw_config);
ret = -EIO;
out:
--
2.47.3
reply other threads:[~2026-11-25 17:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261125172813.1511714-1-a.fatoum@barebox.org \
--to=a.fatoum@barebox.org \
--cc=barebox@lists.infradead.org \
/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