aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/prom.c
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/powerpc/kernel/prom.c
parent[POWERPC] Add cputable entry for PowerPC 440SPe Rev. B (diff)
downloadlinux-dev-972d17c9dbad378da61baa17f4c3ea6e154b186a.tar.xz
linux-dev-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/powerpc/kernel/prom.c')
-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);
}