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>
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_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 @@
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 @@
}
}
- ret = fdt_setprop_u32(fdt, nodeoffset, propname, poffset);
+ ret = fdt_appendprop_u32(fdt, nodeoffset, propname, poffset);
if (ret < 0)
return ret;
}