Hi,

I think if we call fdt_parent_node() and give it the root node, it
should return NULL, as there can't be a parent above it. It should
not start searching for the node somewhere in the tree.

Patrick

diff --git sys/dev/ofw/fdt.c sys/dev/ofw/fdt.c
index c86df3e..aa14507 100644
--- sys/dev/ofw/fdt.c
+++ sys/dev/ofw/fdt.c
@@ -308,6 +308,9 @@ fdt_parent_node(void *node)
        if (!tree_inited)
                return NULL;
 
+       if (node == pnode)
+               return NULL;
+
        return fdt_parent_node_recurse(pnode, node);
 }
 

Reply via email to