[PATCH] ARM: bootm-fip: don't dereference a missing HW_CONFIG
Ahmad Fatoum
a.fatoum at barebox.org
Wed Nov 25 09:28:11 PST 2026
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 at 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
More information about the barebox
mailing list