All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader
@ 2022-06-03 12:15 Miaoqian Lin
  2022-06-03 12:29   ` Arnd Bergmann
  2022-08-02 11:02 ` Michael Ellerman
  0 siblings, 2 replies; 4+ messages in thread
From: Miaoqian Lin @ 2022-06-03 12:15 UTC (permalink / raw)
  To: Jeremy Kerr, Arnd Bergmann, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev,
	linux-kernel
  Cc: linmq006

of_find_node_by_path() returns remote device nodepointer with
refcount incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 0afacde3df4c ("[POWERPC] spufs: allow isolated mode apps by starting the SPE loader")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
 arch/powerpc/platforms/cell/spufs/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 34334c32b7f5..320008528edd 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -660,6 +660,7 @@ spufs_init_isolated_loader(void)
 		return;
 
 	loader = of_get_property(dn, "loader", &size);
+	of_node_put(dn);
 	if (!loader)
 		return;
 
-- 
2.25.1


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

* Re: [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader
  2022-06-03 12:15 [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader Miaoqian Lin
@ 2022-06-03 12:29   ` Arnd Bergmann
  2022-08-02 11:02 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-06-03 12:29 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Jeremy Kerr, Arnd Bergmann, Michael Ellerman,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev,
	Linux Kernel Mailing List

On Fri, Jun 3, 2022 at 2:15 PM Miaoqian Lin <linmq006@gmail.com> wrote:
>
> of_find_node_by_path() returns remote device nodepointer with
> refcount incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 0afacde3df4c ("[POWERPC] spufs: allow isolated mode apps by starting the SPE loader")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>


Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader
@ 2022-06-03 12:29   ` Arnd Bergmann
  0 siblings, 0 replies; 4+ messages in thread
From: Arnd Bergmann @ 2022-06-03 12:29 UTC (permalink / raw)
  To: Miaoqian Lin
  Cc: Arnd Bergmann, Linux Kernel Mailing List, Paul Mackerras,
	Jeremy Kerr, linuxppc-dev

On Fri, Jun 3, 2022 at 2:15 PM Miaoqian Lin <linmq006@gmail.com> wrote:
>
> of_find_node_by_path() returns remote device nodepointer with
> refcount incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 0afacde3df4c ("[POWERPC] spufs: allow isolated mode apps by starting the SPE loader")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>


Acked-by: Arnd Bergmann <arnd@arndb.de>

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

* Re: [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader
  2022-06-03 12:15 [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader Miaoqian Lin
  2022-06-03 12:29   ` Arnd Bergmann
@ 2022-08-02 11:02 ` Michael Ellerman
  1 sibling, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2022-08-02 11:02 UTC (permalink / raw)
  To: linuxppc-dev, Paul Mackerras, Arnd Bergmann, linux-kernel,
	Jeremy Kerr, Benjamin Herrenschmidt, Michael Ellerman,
	Miaoqian Lin

On Fri, 3 Jun 2022 16:15:42 +0400, Miaoqian Lin wrote:
> of_find_node_by_path() returns remote device nodepointer 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/spufs: Fix refcount leak in spufs_init_isolated_loader
      https://git.kernel.org/powerpc/c/6ac059dacffa8ab2f7798f20e4bd3333890c541c

cheers

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

end of thread, other threads:[~2022-08-02 11:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 12:15 [PATCH] powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader Miaoqian Lin
2022-06-03 12:29 ` Arnd Bergmann
2022-06-03 12:29   ` Arnd Bergmann
2022-08-02 11:02 ` 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.