提交 5935ff43 编写于 作者: T Tyrel Datwyler 提交者: Benjamin Herrenschmidt

powerpc/pseries: Child nodes are not detached by dlpar_detach_node

Calls to dlpar_detach_node do not iterate over child nodes detaching them as
well. By iterating and detaching the child nodes we ensure that they have the
OF_DETACHED flag set and that their reference counts are decremented such that
the node will be freed from memory by of_node_release.
Signed-off-by: NTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Acked-by: NNathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
上级 14cd820a
...@@ -286,8 +286,15 @@ int dlpar_attach_node(struct device_node *dn) ...@@ -286,8 +286,15 @@ int dlpar_attach_node(struct device_node *dn)
int dlpar_detach_node(struct device_node *dn) int dlpar_detach_node(struct device_node *dn)
{ {
struct device_node *child;
int rc; int rc;
child = of_get_next_child(dn, NULL);
while (child) {
dlpar_detach_node(child);
child = of_get_next_child(dn, child);
}
rc = of_detach_node(dn); rc = of_detach_node(dn);
if (rc) if (rc)
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册