arm: mach-omap2: omap4-common: Fix refcount leak bug
Subsystems (3)
PATCH v3 1/1 arm: mach-omap2: omap4-common: Fix refcount leak bug
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 <[email protected]>
---
changelog:
v3: change the order of of_node_put() based on tony's advice
v2: merge similar bugs in omap2 into one commit
v1: fix missing of_node_put() bugs
arch/arm/mach-omap2/omap4-common.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/omap4-common.c +1 -0
@@ -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 ; }
Signature · 1 line
2.25.1
Tony Lindgren
maintainerQuoted 3 lines · Liang He
In
omap4_sram_init(),of_find_compatible_node()will return a node pointer with refcount incremented. We should useof_node_put()when it is not used anymore.
Thanks applying into omap-for-v5.20/soc.
Tony