diff options
author | Tyrel Datwyler <tyreld@linux.vnet.ibm.com> | 2013-08-15 01:23:52 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2013-08-27 00:45:16 -0400 |
commit | 5935ff4343a689fbb382d64408bc6955c6589830 (patch) | |
tree | 4f56074bb231126945315d94e2ad68b03a1ca1fa /arch | |
parent | 14cd820a2a45a1f7b216c6ca9104c91d52564fbf (diff) |
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: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Acked-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/powerpc/platforms/pseries/dlpar.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 4ea667d2b0f3..7cfdaae1721a 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -286,8 +286,15 @@ int dlpar_attach_node(struct device_node *dn) | |||
286 | 286 | ||
287 | int dlpar_detach_node(struct device_node *dn) | 287 | int dlpar_detach_node(struct device_node *dn) |
288 | { | 288 | { |
289 | struct device_node *child; | ||
289 | int rc; | 290 | int rc; |
290 | 291 | ||
292 | child = of_get_next_child(dn, NULL); | ||
293 | while (child) { | ||
294 | dlpar_detach_node(child); | ||
295 | child = of_get_next_child(dn, child); | ||
296 | } | ||
297 | |||
291 | rc = of_detach_node(dn); | 298 | rc = of_detach_node(dn); |
292 | if (rc) | 299 | if (rc) |
293 | return rc; | 300 | return rc; |