arm: mach-mvebu: Fix refcount leak bug in pm.c
Subsystems (3)
PATCH 1/1 arm: mach-mvebu: Fix refcount leak bug in pm.c
In mvebu_internal_reg_base(), of_find_node_by_name() 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]>
--- arch/arm/mach-mvebu/pm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm/mach-mvebu/pm.c +6 -1
@@ -91,6 +91,7 @@ static phys_addr_t mvebu_internal_reg_base(void) {struct device_node *np;__be32 in_addr[2 ]; +phys_addr_t addr; np =of_find_node_by_name (NULL ,"internal-regs" );BUG_ON (!np);
@@ -103,7 +104,11 @@ static phys_addr_t mvebu_internal_reg_base(void) in_addr[0 ] =cpu_to_be32 (0xf0010000 ); in_addr[1 ] =0x0 ; -return of_translate_address (np, in_addr); + addr =of_translate_address (np, in_addr); + +of_node_put (np); + +return addr; }static void mvebu_pm_store_armadaxp_bootinfo (u32 *store_addr)
Signature · 1 line
2.25.1