diff options
-rw-r--r-- | arch/powerpc/kernel/prom.c | 3 |
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) | |||
1432 | write_lock(&devtree_lock); | 1432 | write_lock(&devtree_lock); |
1433 | 1433 | ||
1434 | parent = np->parent; | 1434 | parent = np->parent; |
1435 | if (!parent) | ||
1436 | goto out_unlock; | ||
1435 | 1437 | ||
1436 | if (allnodes == np) | 1438 | if (allnodes == np) |
1437 | allnodes = np->allnext; | 1439 | allnodes = np->allnext; |
@@ -1455,6 +1457,7 @@ void of_detach_node(const struct device_node *np) | |||
1455 | prevsib->sibling = np->sibling; | 1457 | prevsib->sibling = np->sibling; |
1456 | } | 1458 | } |
1457 | 1459 | ||
1460 | out_unlock: | ||
1458 | write_unlock(&devtree_lock); | 1461 | write_unlock(&devtree_lock); |
1459 | } | 1462 | } |
1460 | 1463 | ||