summaryrefslogtreecommitdiff
path: root/sys/arch/arm64/stand
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-08-25 10:41:39 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-08-25 10:41:39 +0000
commitcb1a9826d71d9da57c82143861720a7f0f920072 (patch)
tree0080503c855e84c86890d371db901ea4aadfb0fd /sys/arch/arm64/stand
parentd52dbe7a7d3b59a69d51863d434efea9eac94c96 (diff)
Insert new child nodes at the end.
ok patrick@
Diffstat (limited to 'sys/arch/arm64/stand')
-rw-r--r--sys/arch/arm64/stand/efiboot/fdt.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/arm64/stand/efiboot/fdt.c b/sys/arch/arm64/stand/efiboot/fdt.c
index 4927247cbc1..7f9f0a2f2bd 100644
--- a/sys/arch/arm64/stand/efiboot/fdt.c
+++ b/sys/arch/arm64/stand/efiboot/fdt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdt.c,v 1.3 2017/08/23 18:03:54 kettenis Exp $ */
+/* $OpenBSD: fdt.c,v 1.4 2018/08/25 10:41:38 kettenis Exp $ */
/*
* Copyright (c) 2009 Dariusz Swiderski <sfires@sfires.net>
@@ -309,6 +309,10 @@ fdt_node_add_node(void *node, char *name, void **child)
ptr = skip_node_name(ptr + 1);
ptr = skip_props(ptr);
+ /* skip children */
+ while (betoh32(*ptr) == FDT_NODE_BEGIN)
+ ptr = skip_node(ptr);
+
memmove((char *)ptr + len, ptr, tree.end - (char *)ptr);
tree.struct_size += len;
if (tree.strings > tree.tree)