* [PATCH] powerpc/xive: Fix refcount leak in xive_get_max_prio
@ 2022-06-05 5:32 Miaoqian Lin
2022-08-02 11:02 ` Michael Ellerman
0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-06-05 5:32 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
Cédric Le Goater, Miaoqian Lin, Ammar Faizi,
Christophe Leroy, Christophe JAILLET, Nick Child, linuxppc-dev,
linux-kernel
of_find_node_by_path() returns a node pointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.
Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
arch/powerpc/sysdev/xive/spapr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index 7d5128676e83..d398823d138e 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -717,6 +717,7 @@ static bool __init xive_get_max_prio(u8 *max_prio)
}
reg = of_get_property(rootdn, "ibm,plat-res-int-priorities", &len);
+ of_node_put(rootdn);
if (!reg) {
pr_err("Failed to read 'ibm,plat-res-int-priorities' property\n");
return false;
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc/xive: Fix refcount leak in xive_get_max_prio
2022-06-05 5:32 [PATCH] powerpc/xive: Fix refcount leak in xive_get_max_prio Miaoqian Lin
@ 2022-08-02 11:02 ` Michael Ellerman
0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-08-02 11:02 UTC (permalink / raw)
To: linuxppc-dev, Paul Mackerras, linux-kernel, Nick Child,
Christophe JAILLET, Ammar Faizi, Benjamin Herrenschmidt,
Michael Ellerman, Miaoqian Lin, Cédric Le Goater,
Christophe Leroy
On Sun, 5 Jun 2022 09:32:23 +0400, Miaoqian Lin wrote:
> of_find_node_by_path() returns a node pointer with
> refcount incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
>
>
Applied to powerpc/next.
[1/1] powerpc/xive: Fix refcount leak in xive_get_max_prio
https://git.kernel.org/powerpc/c/255b650cbec6849443ce2e0cdd187fd5e61c218c
cheers
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-08-02 11:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-05 5:32 [PATCH] powerpc/xive: Fix refcount leak in xive_get_max_prio Miaoqian Lin
2022-08-02 11:02 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).