[PATCH v2] bootm: Fix bmi->images pointer not initialized in some cases
Tom Rini
trini at konsulko.com
Wed May 21 17:12:46 CEST 2025
On Tue, May 20, 2025 at 10:35:15PM +0200, Benjamin ROBIN wrote:
> When building with only bootz command, without bootm, images pointer
> inside bootm_info structure is not initialized. And since this structure
> is stored in stack, the generated error is kind of random, but most of
> the time this will generate: "ramdisk - allocation error".
>
> Also, after analysis, this problem could occur with the command booti,
> if the command bootm is disabled.
>
> Currently bootm_init() is called by: do_bootz(), do_bootm(), do_booti()
> and by do_stm32prog(). And all of these commands execute bootm_run_states()
> which access the images pointer stored into bootm_info structure.
>
> So, to fix this issue, just do the assignment unconditionally.
>
> Fixes: c2211ff65136 ("bootm: Add more fields to bootm_info")
> Signed-off-by: Benjamin ROBIN <dev at benjarobin.fr>
Reviewed-by: Tom Rini <trini at konsulko.com>
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250521/fb86aaf5/attachment.sig>
More information about the U-Boot
mailing list