]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: ti: clockdomain: fix static checker warning
authorTero Kristo <t-kristo@ti.com>
Mon, 7 Sep 2020 08:25:59 +0000 (11:25 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 10 Nov 2020 09:22:14 +0000 (10:22 +0100)
[ Upstream commit b7a7943fe291b983b104bcbd2f16e8e896f56590 ]

Fix a memory leak induced by not calling clk_put after doing of_clk_get.

Reported-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Link: https://lore.kernel.org/r/20200907082600.454-3-t-kristo@ti.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/ti/clockdomain.c

index b9bc3b8df659d853ba0a51a631f98d9a0f1c33c1..4fde9767392e34863d848e1bd5c904267af40c43 100644 (file)
@@ -124,10 +124,12 @@ static void __init of_ti_clockdomain_setup(struct device_node *node)
                if (clk_hw_get_flags(clk_hw) & CLK_IS_BASIC) {
                        pr_warn("can't setup clkdm for basic clk %s\n",
                                __clk_get_name(clk));
+                       clk_put(clk);
                        continue;
                }
                to_clk_hw_omap(clk_hw)->clkdm_name = clkdm_name;
                omap2_init_clk_clkdm(clk_hw);
+               clk_put(clk);
        }
 }