Skip to content

Commit

Permalink
cpufreq: scmi: Fix use-after-free in scmi_cpufreq_exit()
Browse files Browse the repository at this point in the history
This issue was detected with the help of Coccinelle. So
change the order of function calls to fix it.

Fixes: 1690d8b (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>
  • Loading branch information
Yangtao Li authored and Rafael J. Wysocki committed Feb 19, 2019
1 parent a3b22b9 commit 8cbd468
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/scmi-cpufreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8cbd468

Please sign in to comment.