arm: mach-socfpga: Fix refcount leak bug in socfpga
Subsystems (3)
PATCH 1/1 arm: mach-socfpga: Fix refcount leak bug in socfpga
In socfpga_sysmgr_init(), of_find_compatible_node() will return a node pointer with refcount incremented. We should use of_node_put() when it is not used anymore.
Signed-off-by Liang He <[email protected]>
--- arch/arm/mach-socfpga/socfpga.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/socfpga.c +3 -0
@@ -36,12 +36,15 @@ static void __init socfpga_sysmgr_init(void)sync_cache_w (&socfpga_cpu1start_addr); sys_manager_base_addr =of_iomap (np,0 ); +of_node_put (np); np =of_find_compatible_node (NULL ,NULL ,"altr,rst-mgr" ); rst_manager_base_addr =of_iomap (np,0 ); +of_node_put (np); np =of_find_compatible_node (NULL ,NULL ,"altr,sdr-ctl" ); sdr_ctl_base_addr =of_iomap (np,0 ); +of_node_put (np); }static void __init socfpga_init_irq (void )
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 6 lines · Liang He
In
socfpga_sysmgr_init(),of_find_compatible_node()will return a node pointer with refcount incremented. We should useof_node_put()when it is not used anymore.Signed-off-by Liang He <[email protected]>---
Before applying the patch please check it carefully. Previous evidence [1][2] suggests that not it was not even compiled.
[1] https://lore.kernel.org/all/[email protected]/
[2]
https://lore.kernel.org/all/[email protected]/
Best regards,
Krzysztof