linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: armada-37xx: Fix clock leak
@ 2018-04-04 14:44 Gregory CLEMENT
  2018-04-05  4:51 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Gregory CLEMENT @ 2018-04-04 14:44 UTC (permalink / raw)
  To: linux-arm-kernel

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

Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
Cc: <stable@vger.kernel.org>
Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
---
 drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
 1 file changed, 2 insertions(+)

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++) {
-- 
2.16.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] cpufreq: armada-37xx: Fix clock leak
  2018-04-04 14:44 [PATCH] cpufreq: armada-37xx: Fix clock leak Gregory CLEMENT
@ 2018-04-05  4:51 ` Viresh Kumar
  2018-07-19 10:47   ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2018-04-05  4:51 UTC (permalink / raw)
  To: linux-arm-kernel

On 04-04-18, 16:44, Gregory CLEMENT wrote:
> There was no clk_put() balancing the clk_get(). This commit fixes it.
> 
> Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
> Cc: <stable@vger.kernel.org>
> Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> ---
>  drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> 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++) {

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] cpufreq: armada-37xx: Fix clock leak
  2018-04-05  4:51 ` Viresh Kumar
@ 2018-07-19 10:47   ` Rafael J. Wysocki
  0 siblings, 0 replies; 3+ messages in thread
From: Rafael J. Wysocki @ 2018-07-19 10:47 UTC (permalink / raw)
  To: linux-arm-kernel

On Thursday, April 5, 2018 6:51:53 AM CEST Viresh Kumar wrote:
> On 04-04-18, 16:44, Gregory CLEMENT wrote:
> > There was no clk_put() balancing the clk_get(). This commit fixes it.
> > 
> > Fixes: 92ce45fb875d ("cpufreq: Add DVFS support for Armada 37xx")
> > Cc: <stable@vger.kernel.org>
> > Reported-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> > Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
> > ---
> >  drivers/cpufreq/armada-37xx-cpufreq.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > 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++) {
> 
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> 
> 

Applied, thanks!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-19 10:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-04 14:44 [PATCH] cpufreq: armada-37xx: Fix clock leak Gregory CLEMENT
2018-04-05  4:51 ` Viresh Kumar
2018-07-19 10:47   ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).