summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-06-19 16:07:56 +1000
committerPaul Mackerras <paulus@samba.org>2007-07-10 21:53:45 +1000
commit972d17c9dbad378da61baa17f4c3ea6e154b186a (patch)
tree0e8fb037ceaafbb77a9a66001a4ebeb5ec454217 /arch
parent333e615483afc5203d1cae1490e50982d6eefbea (diff)
downloadlinux-972d17c9dbad378da61baa17f4c3ea6e154b186a.tar.gz
linux-972d17c9dbad378da61baa17f4c3ea6e154b186a.tar.bz2
linux-972d17c9dbad378da61baa17f4c3ea6e154b186a.zip
[POWERPC] Check for the root node in of_detach_node()
It's not sensible to call of_detach_node() on the root node, but we should check for it just to be safe. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/kernel/prom.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 6f32bebd8a9b..cc9632c7149e 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -1432,6 +1432,8 @@ void of_detach_node(const struct device_node *np)
write_lock(&devtree_lock);
parent = np->parent;
+ if (!parent)
+ goto out_unlock;
if (allnodes == np)
allnodes = np->allnext;
@@ -1455,6 +1457,7 @@ void of_detach_node(const struct device_node *np)
prevsib->sibling = np->sibling;
}
+out_unlock:
write_unlock(&devtree_lock);
}