diff options
| author | Vincent Stehlé <vincent.stehle@laposte.net> | 2019-03-27 23:06:42 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-03 06:27:34 +0200 |
| commit | 5f0bf5cd357db62bbbd2b7ba046dbf8b95ea47b6 (patch) | |
| tree | 0b876e6e10705548b4d8270933a48d6a9e6f462d | |
| parent | 7466a2abe75765daf7d00ada675d2f082f5ece2c (diff) | |
| download | talos-obmc-linux-5f0bf5cd357db62bbbd2b7ba046dbf8b95ea47b6.tar.gz talos-obmc-linux-5f0bf5cd357db62bbbd2b7ba046dbf8b95ea47b6.zip | |
cpufreq: scpi: Fix use after free
commit 31d4c528cea4023cf36f6148c03bb960cedefeef upstream.
Free the priv structure only after we are done using it.
Fixes: 1690d8bb91e370ab ("cpufreq: scpi/scmi: Fix freeing of dynamic OPPs")
Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net>
Cc: 4.20+ <stable@vger.kernel.org> # 4.20+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | drivers/cpufreq/scpi-cpufreq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 99449738faa4..632ccf82c5d3 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -189,8 +189,8 @@ static int scpi_cpufreq_exit(struct cpufreq_policy *policy) cpufreq_cooling_unregister(priv->cdev); clk_put(priv->clk); 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; } |

