Skip to contentSkip to conversation

cpufreq: armada-37xx: Fix clock leak

PATCH New Gregory CLEMENT 3 participants 3 messages Apr 4, 2018 – Jul 19, 2018

Subsystems (3)
lore
Share & tools
lore

Gregory CLEMENT

author maintainer
#0 lore raw

PATCH 1/1 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")
---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/armada-37xx-cpufreq.c +2 -0
index c6ebc88a7d8d..72a2975499db 100644
@@ -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++) {
Signature · 1 line
2.16.3
maintainer
#1 lore raw

PATCH 1/1 cpufreq: armada-37xx: Fix clock leak

Quoted 23 lines · Gregory CLEMENT

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

Fixes 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/armada-37xx-cpufreq.c +1 -0
index c6ebc88a7d8d..72a2975499db 100644
@@ -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;
 	}
 

drivers/cpufreq/armada-37xx-cpufreq.c static int __init armada37xx_cpufreq_driver_init(void) · line 217

Quoted 7 lines
drivers/cpufreq/armada-37xx-cpufreq.c +1 -0
@@ -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++) {
Signature · 1 line
viresh
#2 lore raw

PATCH 1/1 cpufreq: armada-37xx: Fix clock leak

Quoted 26 lines · CEST Viresh Kumar
Quoted 25 lines · Gregory CLEMENT

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

Fixes 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/cpufreq/armada-37xx-cpufreq.c +1 -0
index c6ebc88a7d8d..72a2975499db 100644
@@ -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;
 
Quoted 9 lines

drivers/cpufreq/armada-37xx-cpufreq.c static int __init armada37xx_cpufreq_driver_init(void) · line 217

Quoted 5 lines
drivers/cpufreq/armada-37xx-cpufreq.c +1 -0
 	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++) {

Applied, thanks!