Skip to content

Commit 72a2af5

Browse files
windhltsbogend
authored andcommitted
mips: lantiq: falcon: 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 48ca54e commit 72a2af5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/mips/lantiq/falcon/sysctrl.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ void __init ltq_soc_init(void)
208208
of_address_to_resource(np_sysgpe, 0, &res_sys[2]))
209209
panic("Failed to get core resources");
210210

211+
of_node_put(np_status);
212+
of_node_put(np_ebu);
213+
of_node_put(np_sys1);
214+
of_node_put(np_syseth);
215+
of_node_put(np_sysgpe);
216+
211217
if ((request_mem_region(res_status.start, resource_size(&res_status),
212218
res_status.name) < 0) ||
213219
(request_mem_region(res_ebu.start, resource_size(&res_ebu),

0 commit comments

Comments
 (0)