Skip to contentSkip to conversation

powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader

PATCH Applied Miaoqian Lin 3 participants 3 messages Jun 3, 2022 – Aug 2, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/spufs: Fix refcount leak in spufs_init_isolated_loader

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")
---
 arch/powerpc/platforms/cell/spufs/inode.c | 1 +
 1 file changed, 1 insertion(+)
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
index 34334c32b7f5..320008528edd 100644
@@ -660,6 +660,7 @@ spufs_init_isolated_loader(void)
 		return;
 
 	loader = of_get_property(dn, "loader", &size);
+	of_node_put(dn);
 	if (!loader)
 		return;
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Miaoqian Lin

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")