diff options
author | Yangtao Li <tiny.windzz@gmail.com> | 2019-02-16 17:31:48 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-02-19 11:17:37 +0100 |
commit | 8cbd468bdeb5ed3acac2d7a9f7494d5b77e46297 (patch) | |
tree | 734ce65303257279ceb01c26399df6cd2b236e49 /drivers/cpufreq/scmi-cpufreq.c | |
parent | Linux 5.0-rc7 (diff) | |
download | linux-8cbd468bdeb5ed3acac2d7a9f7494d5b77e46297.tar.xz linux-8cbd468bdeb5ed3acac2d7a9f7494d5b77e46297.zip |
cpufreq: scmi: Fix use-after-free in scmi_cpufreq_exit()
This issue was detected with the help of Coccinelle. So
change the order of function calls to fix it.
Fixes: 1690d8bb91e37 (cpufreq: scpi/scmi: Fix freeing of dynamic OPPs)
Signed-off-by: Yangtao Li <tiny.windzz@gmail.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: 4.20+ <stable@vger.kernel.org> # 4.20+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq/scmi-cpufreq.c')
-rw-r--r-- | drivers/cpufreq/scmi-cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/scmi-cpufreq.c b/drivers/cpufreq/scmi-cpufreq.c index 242c3370544e..9ed46d188cb5 100644 --- a/drivers/cpufreq/scmi-cpufreq.c +++ b/drivers/cpufreq/scmi-cpufreq.c @@ -187,8 +187,8 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy) cpufreq_cooling_unregister(priv->cdev); dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table); - kfree(priv); dev_pm_opp_remove_all_dynamic(priv->cpu_dev); + kfree(priv); return 0; } |