summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-07-16 14:48:46 (GMT)
committerGrant Likely <grant.likely@linaro.org>2014-07-23 23:05:45 (GMT)
commit6162dbe49a451f96431a23b4821f05e3bd925bc1 (patch)
tree946033c87a34a385903784f401d3fc5eae67a77c /drivers/of
parent8a2b22a2595bf89d4396530edf8388159fad9d83 (diff)
downloadlinux-6162dbe49a451f96431a23b4821f05e3bd925bc1.tar.xz
of: Make sure attached nodes don't carry along extra children
The child pointer does not get cleared when attaching new nodes which could cause the tree to be inconsistent. Clear the child pointer in __of_attach_node() to be absolutely sure that the structure remains in a consistent layout. Signed-off-by: Grant Likely <grant.likely@linaro.org>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/dynamic.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index c875787..b96d831 100644
--- a/drivers/of/dynamic.c
+++ b/drivers/of/dynamic.c
@@ -98,6 +98,7 @@ int of_property_notify(int action, struct device_node *np,
void __of_attach_node(struct device_node *np)
{
+ np->child = NULL;
np->sibling = np->parent->child;
np->allnext = np->parent->allnext;
np->parent->allnext = np;