diff options
author | 2021-02-04 20:26:36 -0800 | |
---|---|---|
committer | 2025-06-15 18:57:38 +0300 | |
commit | 7764bf9d1d360471a15925fd3cf41363a8e7d6fd (patch) | |
tree | 1cdd2213cc339a16db1c9a274c01a7b2d4830bff | |
parent | fcee4a432d79c473809df5db683be2b2df8e8589 (diff) |
overlay_add_to_local_fixups: Set fixup_str to value
When looping through the fixup string, the current fixup string should
be set to value on each iteration. This matches the loop in
overlay_fixup_phandle. A future enhancement should "inline"
overlay_add_to_local_fixups to avoid looping through the fixup string
twice.
Fixes commit bdc677a4d68f ("libfdt: overlay_merge: Ignore unresolved
symbols").
Change-Id: I4d147551c2d9871cfecb8744aaa718ecf28f0bb7
Signed-off-by: Elliot Berman <eberman@codeaurora.org>
-rw-r--r-- | libfdt/fdt_overlay.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libfdt/fdt_overlay.c b/libfdt/fdt_overlay.c index 2879b04..8b715d6 100644 --- a/libfdt/fdt_overlay.c +++ b/libfdt/fdt_overlay.c @@ -394,8 +394,7 @@ static int overlay_fixup_one_phandle(void *fdt, void *fdto, static int overlay_add_to_local_fixups(void *fdt, const char *value, int len) { - const char *path, *fixup_end, *prop; - const char *fixup_str = value; + const char *path, *fixup_end, *prop, *fixup_str; uint32_t clen; uint32_t fixup_len; char *sep, *endptr; @@ -412,6 +411,8 @@ static int overlay_add_to_local_fixups(void *fdt, const char *value, int len) return localfixup_off; while (len > 0) { + fixup_str = value; + /* Assumes null-terminated properties! */ fixup_end = memchr(value, '\0', len); if (!fixup_end) @@ -515,7 +516,7 @@ static int overlay_add_to_local_fixups(void *fdt, const char *value, int len) } } - ret = fdt_setprop_u32(fdt, nodeoffset, propname, poffset); + ret = fdt_appendprop_u32(fdt, nodeoffset, propname, poffset); if (ret < 0) return ret; } |