ARM: socfpga: Fix OF node refcount leaks in sysmgr init
PATCH 1/1 ARM: socfpga: Fix OF node refcount leaks in sysmgr init
socfpga_sysmgr_init() looks up the sys manager, reset manager, and SDR controller nodes with of_find_compatible_node(). The returned node references are used to read properties and map registers, but none of them are released before np is reused or the function returns.
Drop each reference after the corresponding mapping attempt. The MMIO mappings do not depend on keeping the device node references held.
Fixes 9c4566a117a6 ("ARM: socfpga: Enable SMP for socfpga")
Fixes 44fd8c7d4005 ("ARM: socfpga: support suspend to ram")
Signed-off-by Yuho Choi <[email protected]>
--- arch/arm/mach-socfpga/socfpga.c | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/socfpga.c +3 -0
@@ -34,12 +34,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 )
base-commit: f0100363d8c374bd8e9ea7c9ba02744f0b802ca4
Signature · 1 line
2.43.0