aboutsummaryrefslogtreecommitdiff
path: root/drivers/of/dynamic.c
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@linaro.org>2014-07-16 08:48:46 -0600
committerMark Brown <broonie@kernel.org>2015-02-19 22:42:06 +0900
commitf0122c35d9071b50a79833bd227b9b0537c0ee07 (patch)
treecb41fc3a05d358a4701824eb8a6dc3ff4cea0fdc /drivers/of/dynamic.c
parent8685f844d2ec342529a948b202e96135e81b64e1 (diff)
downloadlinux-linaro-stable-f0122c35d9071b50a79833bd227b9b0537c0ee07.tar.gz
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> (cherry picked from commit 6162dbe49a451f96431a23b4821f05e3bd925bc1) Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/of/dynamic.c')
-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 935e67f9dbd2..3f2eb9fa7fb3 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;