summaryrefslogtreecommitdiff
path: root/drivers/cpufreq/ti-cpufreq.c
diff options
context:
space:
mode:
authorChristophe Jaillet <christophe.jaillet@wanadoo.fr>2017-08-19 23:22:46 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-08-25 02:43:07 +0300
commit9a6e91d08e7707baa2f824257342ca7efcb199bc (patch)
tree9ca86b9e7944ae758dd9df2a80cbb31033ef751c /drivers/cpufreq/ti-cpufreq.c
parentd79d148b6451307fd46e30673ce9de28690c8ced (diff)
downloadlinux-9a6e91d08e7707baa2f824257342ca7efcb199bc.tar.xz
cpufreq: ti: Fix 'of_node_put' being called twice in error handling path
If 'dev_pm_opp_set_supported_hw()' fails, 'opp_data->opp_node' refcount will be decremented 2 times. One, just a few lines above, and another one in the error handling path. Fix it by simply moving the 'of_node_put' call of the normal path. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/ti-cpufreq.c')
-rw-r--r--drivers/cpufreq/ti-cpufreq.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpufreq/ti-cpufreq.c b/drivers/cpufreq/ti-cpufreq.c
index a7b5658c0460..b29cd3398463 100644
--- a/drivers/cpufreq/ti-cpufreq.c
+++ b/drivers/cpufreq/ti-cpufreq.c
@@ -245,8 +245,6 @@ static int ti_cpufreq_init(void)
if (ret)
goto fail_put_node;
- of_node_put(opp_data->opp_node);
-
ret = PTR_ERR_OR_ZERO(dev_pm_opp_set_supported_hw(opp_data->cpu_dev,
version, VERSION_COUNT));
if (ret) {
@@ -255,6 +253,8 @@ static int ti_cpufreq_init(void)
goto fail_put_node;
}
+ of_node_put(opp_data->opp_node);
+
register_cpufreq_dt:
platform_device_register_simple("cpufreq-dt", -1, NULL, 0);