Re: [PATCH v2] cpufreq: Make cpufreq_quick_get() safe to call.
From: Viresh Kumar
Date: Fri Mar 11 2016 - 18:52:46 EST
On 11-03-16, 09:43, Richard Cochran wrote:
> The function, cpufreq_quick_get, accesses the global 'cpufreq_driver' and
> its fields without taking the associated lock, cpufreq_driver_lock.
> Without the locking, nothing guarantees that 'cpufreq_driver' remains
> consistent during the call. This patch fixes the issue by taking the lock
> before accessing the data structure.
> Cc: Dirk Brandewie <dirk.brandewie@xxxxxxxxx>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@xxxxxxxxx>
> Cc: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> Cc: linux-pm@xxxxxxxxxxxxxxx
> Signed-off-by: Richard Cochran <rcochran@xxxxxxxxxxxxx>
> drivers/cpufreq/cpufreq.c | 12 ++++++++++--
> 1 file changed, 10 insertions(+), 2 deletions(-)
Acked-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>