Skip to content

Commit 7669559

Browse files
windhltsbogend
authored andcommitted
mips: lantiq: xway: Fix refcount leak bug in sysctrl
In ltq_soc_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]> Signed-off-by: Thomas Bogendoerfer <[email protected]>
1 parent 72a2af5 commit 7669559

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/mips/lantiq/xway/sysctrl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,10 @@ void __init ltq_soc_init(void)
441441
of_address_to_resource(np_ebu, 0, &res_ebu))
442442
panic("Failed to get core resources");
443443

444+
of_node_put(np_pmu);
445+
of_node_put(np_cgu);
446+
of_node_put(np_ebu);
447+
444448
if (!request_mem_region(res_pmu.start, resource_size(&res_pmu),
445449
res_pmu.name) ||
446450
!request_mem_region(res_cgu.start, resource_size(&res_cgu),

0 commit comments

Comments
 (0)