powerpc/cell: Fix refcount leak bugs
Subsystems (3)
PATCH 1/1 powerpc/cell: Fix refcount leak bugs
We should use of_node_put() for of_find_node_by_path() and of_find_node_by_phandle() to keep refcount balance.
Signed-off-by Liang He <[email protected]>
--- arch/powerpc/platforms/cell/setup.c | 2 ++ arch/powerpc/platforms/cell/spu_manage.c | 2 ++ arch/powerpc/platforms/cell/spufs/inode.c | 1 + 3 files changed, 5 insertions(+)
arch/powerpc/platforms/cell/setup.c +2 -0
@@ -167,6 +167,8 @@ static int __init cell_publish_devices(void)of_platform_device_create (np,NULL ,NULL ); } +of_node_put (root); +/* There is no device for the MIC memory controller, thus we create * a platform device for it to attach the EDAC driver to. */
arch/powerpc/platforms/cell/spu_manage.c +2 -0
@@ -488,6 +488,8 @@ static void __init init_affinity_node(int cbe) avoid_ph = vic_dn->phandle; } +of_node_put (vic_dn); +list_add_tail (&spu->aff_list, &last_spu->aff_list); last_spu = spu;break ;
arch/powerpc/platforms/cell/spufs/inode.c +1 -0
@@ -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
Michael Ellerman
AppliedQuoted 4 lines · Liang He
We should use
of_node_put()forof_find_node_by_path()andof_find_node_by_phandle()to keep refcount balance.
Applied to powerpc/next.
[1/1] powerpc/cell: Fix refcount leak bugs
https://git.kernel.org/powerpc/c/d9e1c6104d87d4027133b28f5ccab8f999830acd
cheers