]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ARM: OMAP2+: hwmod: Add of_node_put() before break
authorWan Jiabing <wanjiabing@vivo.com>
Thu, 14 Oct 2021 08:57:19 +0000 (04:57 -0400)
committerTony Lindgren <tony@atomide.com>
Fri, 17 Dec 2021 12:08:10 +0000 (14:08 +0200)
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>
arch/arm/mach-omap2/omap_hwmod.c

index ccb0e3732c0dc15d72b133e57b98fe3cdf86aad5..31d1a21f60416db586ad28dbd3d829cc1a0ce860 100644 (file)
@@ -752,8 +752,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;