Skip to content

Commit

Permalink
cpufreq: don't leave stale policy pointer in cdbs->cur_policy
Browse files Browse the repository at this point in the history
Clear ->cur_policy when stopping a governor, or the ->cur_policy
pointer may be stale on systems with have_governor_per_policy when a
new policy is allocated due to CPU hotplug offline/online.

[rjw: Changelog]
Suggested-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Jacob Shin <jacob.shin@amd.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Jacob Shin authored and Rafael J. Wysocki committed Jun 27, 2013
1 parent 874e628 commit 419e172
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/cpufreq/cpufreq_governor.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ int cpufreq_governor_dbs(struct cpufreq_policy *policy,

mutex_lock(&dbs_data->mutex);
mutex_destroy(&cpu_cdbs->timer_mutex);
cpu_cdbs->cur_policy = NULL;

mutex_unlock(&dbs_data->mutex);

Expand Down

0 comments on commit 419e172

Please sign in to comment.