OF: base: fix inifinite looping in node iterators
of_find_node_by_name suffers from infinite looping, because it
does not check for root node of the tree iterated over. This
fixes this by checking for node->parent to determine whether
the last node has been reached.
Since of_tree_for_each_node does not iterate over the whole tree,
but only over the remaining nodes, rename it to
of_tree_for_each_node_from.

Reported-by: NISHIMOTO Hiroki <hiroki.nishimoto.if@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 9ab76a4 commit 73986cc87d322fcb698f11aee4f0b93401c005a0
@Sascha Hauer Sascha Hauer authored on 4 Jul 2013
Showing 1 changed file
View
drivers/of/base.c