mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 14:11:52 +00:00
cpufreq: davinci: Fix clk use after free
The remove function first frees the clks and only then calls
cpufreq_unregister_driver(). If one of the cpufreq callbacks is called
just before cpufreq_unregister_driver() is run, the freed clks might be
used.
Fixes: 6601b8030d
("davinci: add generic CPUFreq driver for DaVinci")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
7cca9a9851
commit
5d8f384a9b
@ -133,13 +133,13 @@ static int __init davinci_cpufreq_probe(struct platform_device *pdev)
|
||||
|
||||
static int __exit davinci_cpufreq_remove(struct platform_device *pdev)
|
||||
{
|
||||
cpufreq_unregister_driver(&davinci_driver);
|
||||
|
||||
clk_put(cpufreq.armclk);
|
||||
|
||||
if (cpufreq.asyncclk)
|
||||
clk_put(cpufreq.asyncclk);
|
||||
|
||||
cpufreq_unregister_driver(&davinci_driver);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user