Skip to content

Commit 8cbd468

Browse files
TinyWindzzrafaeljw
authored andcommitted
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: 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>
1 parent a3b22b9 commit 8cbd468

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/cpufreq/scmi-cpufreq.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ static int scmi_cpufreq_exit(struct cpufreq_policy *policy)
187187

188188
cpufreq_cooling_unregister(priv->cdev);
189189
dev_pm_opp_free_cpufreq_table(priv->cpu_dev, &policy->freq_table);
190-
kfree(priv);
191190
dev_pm_opp_remove_all_dynamic(priv->cpu_dev);
191+
kfree(priv);
192192

193193
return 0;
194194
}

0 commit comments

Comments
 (0)