Skip to content

Commit 85f0e42

Browse files
vireshkrafaeljw
authored andcommitted
Revert "cpufreq: Fix possible race in cpufreq online error path"
This reverts commit f346e96. The commit tried to fix a possible real bug but it made it even worse. The fix was simply buggy as now an error out to out_offline_policy or out_exit_policy will try to release a semaphore which was never taken in the first place. This works fine only if we failed late, i.e. via out_destroy_policy. Fixes: f346e96 ("cpufreq: Fix possible race in cpufreq online error path") Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 740fcdc commit 85f0e42

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/cpufreq/cpufreq.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,8 @@ static int cpufreq_online(unsigned int cpu)
15341534
for_each_cpu(j, policy->real_cpus)
15351535
remove_cpu_dev_symlink(policy, get_cpu_device(j));
15361536

1537+
up_write(&policy->rwsem);
1538+
15371539
out_offline_policy:
15381540
if (cpufreq_driver->offline)
15391541
cpufreq_driver->offline(policy);
@@ -1542,9 +1544,6 @@ static int cpufreq_online(unsigned int cpu)
15421544
if (cpufreq_driver->exit)
15431545
cpufreq_driver->exit(policy);
15441546

1545-
cpumask_clear(policy->cpus);
1546-
up_write(&policy->rwsem);
1547-
15481547
out_free_policy:
15491548
cpufreq_policy_free(policy);
15501549
return ret;

0 commit comments

Comments
 (0)