]> git.ipfire.org Git - thirdparty/u-boot.git/commit
common/spl: fix endless loop in spl_fit_append_fdt()
authorMichael Walle <mwalle@kernel.org>
Fri, 31 Oct 2025 13:13:52 +0000 (14:13 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 6 Nov 2025 14:31:14 +0000 (08:31 -0600)
commit52442205d30eec4571a466c78dee0047677be56c
treeea523afc883541a2db43b001bdde95a6b55433b6
parentb790f31752d7650d5f557509f17b1396f0cc1f70
common/spl: fix endless loop in spl_fit_append_fdt()

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@kernel.org>
common/spl/spl_fit.c