All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup
@ 2022-05-12 12:37 Miaoqian Lin
  2022-05-24 11:09 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Miaoqian Lin @ 2022-05-12 12:37 UTC (permalink / raw)
  To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras,
	Christophe Leroy, Miaoqian Lin, Nicholas Piggin, Liu Gang,
	Jin Qing, Alexandre Bounine, Li Yang, Kumar Gala, linuxppc-dev,
	linux-kernel

of_parse_phandle() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Fixes: abc3aeae3aaa ("fsl-rio: Add two ports and rapidio message units support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/powerpc/sysdev/fsl_rio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/powerpc/sysdev/fsl_rio.c b/arch/powerpc/sysdev/fsl_rio.c
index ff7906b48ca1..1bfc9afa8a1a 100644
--- a/arch/powerpc/sysdev/fsl_rio.c
+++ b/arch/powerpc/sysdev/fsl_rio.c
@@ -505,8 +505,10 @@ int fsl_rio_setup(struct platform_device *dev)
 	if (rc) {
 		dev_err(&dev->dev, "Can't get %pOF property 'reg'\n",
 				rmu_node);
+		of_node_put(rmu_node);
 		goto err_rmu;
 	}
+	of_node_put(rmu_node);
 	rmu_regs_win = ioremap(rmu_regs.start, resource_size(&rmu_regs));
 	if (!rmu_regs_win) {
 		dev_err(&dev->dev, "Unable to map rmu register window\n");
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup
  2022-05-12 12:37 [PATCH] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Miaoqian Lin
@ 2022-05-24 11:09 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
  To: Miaoqian Lin, Li Yang, Kumar Gala, linux-kernel, Jin Qing,
	Alexandre Bounine, Liu Gang, Nicholas Piggin, Michael Ellerman,
	Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	linuxppc-dev

On Thu, 12 May 2022 16:37:18 +0400, Miaoqian Lin wrote:
> of_parse_phandle() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when not need anymore.
> Add missing of_node_put() to avoid refcount leak.
> 
> 

Applied to powerpc/next.

[1/1] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup
      https://git.kernel.org/powerpc/c/fcee96924ba1596ca80a6770b2567ca546f9a482

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-24 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-12 12:37 [PATCH] powerpc/fsl_rio: Fix refcount leak in fsl_rio_setup Miaoqian Lin
2022-05-24 11:09 ` 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.