Commit bbcc3285 authored by Gregory CLEMENT's avatar Gregory CLEMENT Committed by Rafael J. Wysocki

cpufreq: armada-37xx: Fix clock leak

There was no clk_put() balancing the clk_get(). This commit fixes it.

Fixes: 92ce45fb (cpufreq: Add DVFS support for Armada 37xx)
Cc: 4.16+ <stable@vger.kernel.org> # 4.16+
Reported-by: default avatarThomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: default avatarGregory CLEMENT <gregory.clement@bootlin.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b8b10bc2
...@@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_driver_init(void) ...@@ -202,6 +202,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
cur_frequency = clk_get_rate(clk); cur_frequency = clk_get_rate(clk);
if (!cur_frequency) { if (!cur_frequency) {
dev_err(cpu_dev, "Failed to get clock rate for CPU\n"); dev_err(cpu_dev, "Failed to get clock rate for CPU\n");
clk_put(clk);
return -EINVAL; return -EINVAL;
} }
...@@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_driver_init(void) ...@@ -210,6 +211,7 @@ static int __init armada37xx_cpufreq_driver_init(void)
return -EINVAL; return -EINVAL;
armada37xx_cpufreq_dvfs_setup(nb_pm_base, clk, dvfs->divider); 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; for (load_lvl = ARMADA_37XX_DVFS_LOAD_0; load_lvl < LOAD_LEVEL_NR;
load_lvl++) { load_lvl++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment