* [PATCH] powerpc/pseries: Fix node leak in update_lmb_associativity_index()
@ 2018-11-27 8:16 Michael Ellerman
2018-12-23 13:27 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Michael Ellerman @ 2018-11-27 8:16 UTC (permalink / raw)
To: linuxppc-dev
In update_lmb_associativity_index() we lookup dr_node using
of_find_node_by_path() which takes a reference for us. In the
non-error case we forget to drop the reference. Note that
find_aa_index() does modify properties of the node, but doesn't need
an extra reference held once it's returned.
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
arch/powerpc/platforms/pseries/hotplug-memory.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c
index 2b796da822c2..10e2b5a9acf6 100644
--- a/arch/powerpc/platforms/pseries/hotplug-memory.c
+++ b/arch/powerpc/platforms/pseries/hotplug-memory.c
@@ -197,6 +197,7 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb)
found = find_aa_index(dr_node, ala_prop, lmb_assoc, &aa_index);
+ of_node_put(dr_node);
dlpar_free_cc_nodes(lmb_node);
if (!found) {
--
2.17.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: powerpc/pseries: Fix node leak in update_lmb_associativity_index()
2018-11-27 8:16 [PATCH] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Michael Ellerman
@ 2018-12-23 13:27 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2018-12-23 13:27 UTC (permalink / raw)
To: Michael Ellerman, linuxppc-dev
On Tue, 2018-11-27 at 08:16:44 UTC, Michael Ellerman wrote:
> In update_lmb_associativity_index() we lookup dr_node using
> of_find_node_by_path() which takes a reference for us. In the
> non-error case we forget to drop the reference. Note that
> find_aa_index() does modify properties of the node, but doesn't need
> an extra reference held once it's returned.
>
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Applied to powerpc next.
https://git.kernel.org/powerpc/c/47918bc68b7427e961035949cc1501
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-23 13:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 8:16 [PATCH] powerpc/pseries: Fix node leak in update_lmb_associativity_index() Michael Ellerman
2018-12-23 13:27 ` Michael Ellerman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.