ARM: OMAP2+: omap4-common: Fix refcount leak bug

[ Upstream commit 7c32919a37 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Liang He 2022-06-28 19:29:39 +08:00 committed by Greg Kroah-Hartman
parent 4a46f52ae8
commit 1d9452ae3b

View 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;
}