linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cpufreq: pmac32-cpufreq: Fix refcount leak bug
@ 2022-06-18  2:25 Liang He
  2022-06-20  4:42 ` Viresh Kumar
  0 siblings, 1 reply; 2+ messages in thread
From: Liang He @ 2022-06-18  2:25 UTC (permalink / raw)
  To: rafael, viresh.kumar, mpe, benh, paulus
  Cc: windhl, linux-pm, linuxppc-dev, linux-kernel

In pmac_cpufreq_init_MacRISC3(), we need to add corresponding
of_node_put() for the three node pointers whose refcount have
been incremented by of_find_node_by_name().

Signed-off-by: Liang He <windhl@126.com>
---
 drivers/cpufreq/pmac32-cpufreq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
index 20f64a8b0a35..4b8ee2014da6 100644
--- a/drivers/cpufreq/pmac32-cpufreq.c
+++ b/drivers/cpufreq/pmac32-cpufreq.c
@@ -470,6 +470,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
 	if (slew_done_gpio_np)
 		slew_done_gpio = read_gpio(slew_done_gpio_np);
 
+	of_node_put(volt_gpio_np);
+	of_node_put(freq_gpio_np);
+	of_node_put(slew_done_gpio_np);
+
 	/* If we use the frequency GPIOs, calculate the min/max speeds based
 	 * on the bus frequencies
 	 */
-- 
2.25.1


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

* Re: [PATCH] cpufreq: pmac32-cpufreq: Fix refcount leak bug
  2022-06-18  2:25 [PATCH] cpufreq: pmac32-cpufreq: Fix refcount leak bug Liang He
@ 2022-06-20  4:42 ` Viresh Kumar
  0 siblings, 0 replies; 2+ messages in thread
From: Viresh Kumar @ 2022-06-20  4:42 UTC (permalink / raw)
  To: Liang He; +Cc: rafael, mpe, benh, paulus, linux-pm, linuxppc-dev, linux-kernel

On 18-06-22, 10:25, Liang He wrote:
> In pmac_cpufreq_init_MacRISC3(), we need to add corresponding
> of_node_put() for the three node pointers whose refcount have
> been incremented by of_find_node_by_name().
> 
> Signed-off-by: Liang He <windhl@126.com>
> ---
>  drivers/cpufreq/pmac32-cpufreq.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/cpufreq/pmac32-cpufreq.c b/drivers/cpufreq/pmac32-cpufreq.c
> index 20f64a8b0a35..4b8ee2014da6 100644
> --- a/drivers/cpufreq/pmac32-cpufreq.c
> +++ b/drivers/cpufreq/pmac32-cpufreq.c
> @@ -470,6 +470,10 @@ static int pmac_cpufreq_init_MacRISC3(struct device_node *cpunode)
>  	if (slew_done_gpio_np)
>  		slew_done_gpio = read_gpio(slew_done_gpio_np);
>  
> +	of_node_put(volt_gpio_np);
> +	of_node_put(freq_gpio_np);
> +	of_node_put(slew_done_gpio_np);
> +
>  	/* If we use the frequency GPIOs, calculate the min/max speeds based
>  	 * on the bus frequencies
>  	 */

Applied. Thanks.

-- 
viresh

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

end of thread, other threads:[~2022-06-20  4:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-18  2:25 [PATCH] cpufreq: pmac32-cpufreq: Fix refcount leak bug Liang He
2022-06-20  4:42 ` Viresh Kumar

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).