提交 972d17c9 编写于 作者: M Michael Ellerman 提交者: Paul Mackerras

[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: NMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 333e6154
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册