Skip to content

Commit 0f83e6b

Browse files
Yuuoniytmlind
authored andcommitted
ARM: OMAP2+: Fix refcount leak in omap_gic_of_init
The of_find_compatible_node() function returns a node pointer with refcount incremented, We should use of_node_put() on it when done Add the missing of_node_put() to release the refcount. Fixes: fd1c078 ("ARM: OMAP4: Fix the init code to have OMAP4460 errata available in DT build") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> Message-Id: <20220309104302.18398-1-linmq006@gmail.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
1 parent 71ff461 commit 0f83e6b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

arch/arm/mach-omap2/omap4-common.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,10 +314,12 @@ void __init omap_gic_of_init(void)
314314

315315
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
316316
gic_dist_base_addr = of_iomap(np, 0);
317+
of_node_put(np);
317318
WARN_ON(!gic_dist_base_addr);
318319

319320
np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
320321
twd_base = of_iomap(np, 0);
322+
of_node_put(np);
321323
WARN_ON(!twd_base);
322324

323325
skip_errata_init:

0 commit comments

Comments
 (0)