diff mbox series

powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader

Message ID 20220603121543.22884-1-linmq006@gmail.com (mailing list archive)
State Accepted
Headers show
Series powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader | expand

Checks

Context Check Description
snowpatch_ozlabs/github-powerpc_selftests success Successfully ran 10 jobs.
snowpatch_ozlabs/github-powerpc_ppctests success Successfully ran 10 jobs.
snowpatch_ozlabs/github-powerpc_clang success Successfully ran 7 jobs.
snowpatch_ozlabs/github-powerpc_sparse success Successfully ran 4 jobs.
snowpatch_ozlabs/github-powerpc_kernel_qemu success Successfully ran 23 jobs.

Commit Message

Miaoqian Lin June 3, 2022, 12:15 p.m. UTC
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(+)

Comments

Arnd Bergmann June 3, 2022, 12:29 p.m. UTC | #1
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>
Michael Ellerman Aug. 2, 2022, 11:02 a.m. UTC | #2
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
diff mbox series

Patch

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;