[PATCH] common/spl: fix endless loop in spl_fit_append_fdt()

Michael Walle mwalle at kernel.org
Fri Oct 31 14:13:33 CET 2025


On Tue Oct 28, 2025 at 12:03 AM CET, Tom Rini wrote:
> On Mon, Oct 27, 2025 at 12:05:21PM +0100, Michael Walle wrote:
>
>> Technically, commit 24bf44cf88e7 ("spl: fit: Do not fail immediately if
>> an overlay is not available") introduced that regression as the code
>> will never advance if spl_fit_get_image_name() will return an error. But
>> at that time, spl_fit_get_image_node() was used in spl_fit_append_fdt()
>> which calls fdt_subnode_offset() to get the image node. And I presume
>> the commit was about the latter failing gracefully and trying the next
>> one.
>> 
>> But with commit b13eaf3bb4e6 ("spl: fit: Add board level function to
>> decide application of DTO") that behavior changed and the loop in
>> spl_fit_append_fdt() no longer uses spl_fit_get_image_node() but
>> spl_fit_get_image_name() directly. Thus it doesn't make any sense to not
>> break the loop if that fails.
>> 
>> Also, the original use case of commit 24bf44cf88e7 ("spl: fit: Do not
>> fail immediately if an overlay is not available") is preserved because
>> spl_subnode_offset() is now called within the loop and errors are
>> handled gracefully (and advancing the index).
>> 
>> Fixes: b13eaf3bb4e6 ("spl: fit: Add board level function to decide application of DTO")
>> Signed-off-by: Michael Walle <mwalle at kernel.org>
>
> Thanks for explaining what's going on in such detail.
>
> Reviewed-by: Tom Rini <trini at konsulko.com>

Please don't pick this up. There will be a v2 as this is breaking
any subsequent code in the loop.

-michael
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 297 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20251031/5c99ae1d/attachment.sig>


More information about the U-Boot mailing list