summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-06-18 04:25:45 +0200
committerViresh Kumar <viresh.kumar@linaro.org>2022-06-28 10:04:51 +0200
commitccd7567d4b6cf187fdfa55f003a9e461ee629e36 (patch)
treed595ed2e9aa2b9a9326a3f917ea80e34c306ebef /drivers/cpufreq
parentcpufreq: qcom-hw: Don't do lmh things without a throttle interrupt (diff)
downloadlinux-ccd7567d4b6cf187fdfa55f003a9e461ee629e36.tar.xz
linux-ccd7567d4b6cf187fdfa55f003a9e461ee629e36.zip
cpufreq: pmac32-cpufreq: Fix refcount leak bug
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> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/pmac32-cpufreq.c4
1 files changed, 4 insertions, 0 deletions
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
*/