summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/armada-37xx-cpufreq.c
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@bootlin.com>2018-04-04 17:44:44 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-04-10 09:38:02 +0300
commitbbcc328561040292f7d6796954d478e4a2335e6f (patch)
tree9dfaaa60cfe1db59e63e6b8453b332273efbe072 /drivers/cpufreq/armada-37xx-cpufreq.c
parentb8b10bc2015cd91350aac68447377c8410a48865 (diff)
downloadlinux-bbcc328561040292f7d6796954d478e4a2335e6f.tar.xz
cpufreq: armada-37xx: Fix clock leak
There was no clk_put() balancing the clk_get(). This commit fixes it. Fixes: 92ce45fb875d (cpufreq: Add DVFS support for Armada 37xx) Cc: 4.16+ <stable@vger.kernel.org> # 4.16+ Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/armada-37xx-cpufreq.c')
-rw-r--r--drivers/cpufreq/armada-37xx-cpufreq.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/cpufreq/armada-37xx-cpufreq.c b/drivers/cpufreq/armada-37xx-cpufreq.c
index c6ebc88a7d8d..72a2975499db 100644
--- a/drivers/cpufreq/armada-37xx-cpufreq.c
+++ b/drivers/cpufreq/armada-37xx-cpufreq.c
@@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
cur_frequency = clk_get_rate(clk);
if (!cur_frequency) {
dev_err(cpu_dev, "Failed to get clock rate for CPU\n");
+ clk_put(clk);
return -EINVAL;
}
@@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
return -EINVAL;
armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider);
+ clk_put(clk);
for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR;
load_lvl++) {