summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/maple-cpufreq.c
diff options
context:
space:
mode:
authorWen Yang <wen.yang99@zte.com.cn>2019-04-01 03:37:51 +0200
committerViresh Kumar <viresh.kumar@linaro.org>2019-04-08 12:07:06 +0200
commitddb07fba1c645791ead16d1eee0639a033fb8cf9 (patch)
tree8bc2f2f0a9e98437118ad3729896897e138ce7f0 /drivers/cpufreq/maple-cpufreq.c
parentcpufreq: kirkwood: fix possible object reference leak (diff)
downloadlinux-ddb07fba1c645791ead16d1eee0639a033fb8cf9.tar.xz
linux-ddb07fba1c645791ead16d1eee0639a033fb8cf9.zip
cpufreq: maple: fix possible object reference leak
The call to of_cpu_device_node_get returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. Detected by coccinelle with the following warnings: ./drivers/cpufreq/maple-cpufreq.c:213:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 177, but without a corresponding object release within this function. Signed-off-by: Wen Yang <wen.yang99@zte.com.cn> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Cc: Viresh Kumar <viresh.kumar@linaro.org> Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Diffstat (limited to 'drivers/cpufreq/maple-cpufreq.c')
-rw-r--r--drivers/cpufreq/maple-cpufreq.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c
index d9df89392b84..a05f1342ec02 100644
--- a/drivers/cpufreq/maple-cpufreq.c
+++ b/drivers/cpufreq/maple-cpufreq.c
@@ -210,7 +210,7 @@ static int __init maple_cpufreq_init(void)
*/
valp = of_get_property(cpunode, "clock-frequency", NULL);
if (!valp)
- return -ENODEV;
+ goto bail_noprops;
max_freq = (*valp)/1000;
maple_cpu_freqs[0].frequency = max_freq;
maple_cpu_freqs[1].frequency = max_freq/2;