diff options
| author | Aristo Chen <[email protected]> | 2026-05-08 21:31:59 +0000 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-25 13:44:10 -0600 |
| commit | 646be6d5cd37dc9f1e79f4c6677b872932605a2b (patch) | |
| tree | 6a60d723cff002253b0a4e4e0413f5b3565d615c | |
| parent | 3cdd19089f1b1b7cd08530f33ff4708abcfd426c (diff) | |
boot/fit: read default-config property from the configurations node
In fit_print_contents() the default configuration's unit name is read by
calling fdt_getprop() with noffset rather than confs_noffset. Today this
happens to work by coincidence: the preceding loop walks /images using
fdt_next_node(), and when iteration leaves the subtree libfdt returns
the offset of the next sibling in DFS order, which by FIT layout
convention is /configurations. The depth counter then drops below zero
and the loop exits with noffset still pointing at /configurations.
This relies on /images and /configurations being adjacent siblings and
on the implementation detail of fdt_next_node()'s post-exhaustion
return value. It also blocks a follow-up conversion to
fdt_for_each_subnode(), whose post-loop loop variable is a negative
error code rather than a valid offset.
Use confs_noffset directly, which the comment immediately above the
call already names as the source.
Signed-off-by: Aristo Chen <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | boot/image-fit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/boot/image-fit.c b/boot/image-fit.c index 2d2709aa5b1..5a502e93106 100644 --- a/boot/image-fit.c +++ b/boot/image-fit.c @@ -449,7 +449,7 @@ void fit_print_contents(const void *fit) } /* get default configuration unit name from default property */ - uname = (char *)fdt_getprop(fit, noffset, FIT_DEFAULT_PROP, NULL); + uname = (char *)fdt_getprop(fit, confs_noffset, FIT_DEFAULT_PROP, NULL); if (uname) printf("%s Default Configuration: '%s'\n", p, uname); |
