]> git.itanic.dy.fi Git - linux-stable/commitdiff
ARM: OMAP2+: omap4-common: Fix refcount leak bug
authorLiang He <windhl@126.com>
Tue, 28 Jun 2022 11:29:39 +0000 (19:29 +0800)
committerTony Lindgren <tony@atomide.com>
Tue, 27 Dec 2022 05:21:41 +0000 (07:21 +0200)
In omap4_sram_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 <windhl@126.com>
Message-Id: <20220628112939.160737-1-windhl@126.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/omap4-common.c

index 6d1eb4eefefe58640515d6ec7029d4425259fc57..d9ed2a5dcd5efbc06fb139323becb40be9493321 100644 (file)
@@ -140,6 +140,7 @@ static int __init omap4_sram_init(void)
                        __func__);
        else
                sram_sync = (void __iomem *)gen_pool_alloc(sram_pool, PAGE_SIZE);
+       of_node_put(np);
 
        return 0;
 }