]> Git Repo - linux.git/commitdiff
cpufreq: pmac32-cpufreq: Fix refcount leak bug
authorLiang He <[email protected]>
Sat, 18 Jun 2022 02:25:45 +0000 (10:25 +0800)
committerViresh Kumar <[email protected]>
Tue, 28 Jun 2022 08:04:51 +0000 (13:34 +0530)
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 <[email protected]>
Signed-off-by: Viresh Kumar <[email protected]>
drivers/cpufreq/pmac32-cpufreq.c

index 20f64a8b0a354d8a7aad6caa12aff6969a20ba38..4b8ee2014da6dbb05a15900e629fea8b63c60a93 100644 (file)
@@ -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
         */
This page took 0.057063 seconds and 4 git commands to generate.