Skip to content

Commit

Permalink
ARM: OMAP2+: hwmod: Add of_node_put() before break
Browse files Browse the repository at this point in the history
[ Upstream commit 80c469a ]

Fix following coccicheck warning:
./arch/arm/mach-omap2/omap_hwmod.c:753:1-23: WARNING: Function
for_each_matching_node should have of_node_put() before break

Early exits from for_each_matching_node should decrement the
node reference counter.

Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Wan Jiabing authored and gregkh committed Feb 23, 2022
1 parent 521dcc1 commit 6932353
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/arm/mach-omap2/omap_hwmod.c
Expand Up @@ -749,8 +749,10 @@ static int __init _init_clkctrl_providers(void)

for_each_matching_node(np, ti_clkctrl_match_table) {
ret = _setup_clkctrl_provider(np);
if (ret)
if (ret) {
of_node_put(np);
break;
}
}

return ret;
Expand Down

0 comments on commit 6932353

Please sign in to comment.