diff options
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r-- | drivers/cpufreq/cpufreq.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 4ed665725cc5..e59cb470914a 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -1080,6 +1080,7 @@ err_out_unregister: | |||
1080 | 1080 | ||
1081 | err_unlock_policy: | 1081 | err_unlock_policy: |
1082 | unlock_policy_rwsem_write(cpu); | 1082 | unlock_policy_rwsem_write(cpu); |
1083 | free_cpumask_var(policy->related_cpus); | ||
1083 | err_free_cpumask: | 1084 | err_free_cpumask: |
1084 | free_cpumask_var(policy->cpus); | 1085 | free_cpumask_var(policy->cpus); |
1085 | err_free_policy: | 1086 | err_free_policy: |
@@ -1765,17 +1766,8 @@ static int __cpufreq_set_policy(struct cpufreq_policy *data, | |||
1765 | dprintk("governor switch\n"); | 1766 | dprintk("governor switch\n"); |
1766 | 1767 | ||
1767 | /* end old governor */ | 1768 | /* end old governor */ |
1768 | if (data->governor) { | 1769 | if (data->governor) |
1769 | /* | ||
1770 | * Need to release the rwsem around governor | ||
1771 | * stop due to lock dependency between | ||
1772 | * cancel_delayed_work_sync and the read lock | ||
1773 | * taken in the delayed work handler. | ||
1774 | */ | ||
1775 | unlock_policy_rwsem_write(data->cpu); | ||
1776 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); | 1770 | __cpufreq_governor(data, CPUFREQ_GOV_STOP); |
1777 | lock_policy_rwsem_write(data->cpu); | ||
1778 | } | ||
1779 | 1771 | ||
1780 | /* start new governor */ | 1772 | /* start new governor */ |
1781 | data->governor = policy->governor; | 1773 | data->governor = policy->governor; |