PM / devfreq: Fix error handling in governor_cpufreq

put_online_cpus() is not called if an error occurs during cpufreq
notification registration. Fix the error path by calling it properly.

Change-Id: Ia2e6b2debb2db4b39f8fcfcd1ee873538b44d405
Signed-off-by: Junjie Wu <junjiew@codeaurora.org>
This commit is contained in:
Junjie Wu 2014-11-05 11:49:10 -08:00 committed by David Keitel
parent 2830b6d0c9
commit 3a1979a9e8

View file

@ -243,7 +243,7 @@ static int register_cpufreq(void)
mutex_lock(&state_lock);
if (cpufreq_cnt)
goto out;
goto cnt_not_zero;
get_online_cpus();
ret = cpufreq_register_notifier(&cpufreq_policy_nb,
@ -266,9 +266,9 @@ static int register_cpufreq(void)
cpufreq_cpu_put(policy);
}
}
put_online_cpus();
out:
put_online_cpus();
cnt_not_zero:
if (!ret)
cpufreq_cnt++;
mutex_unlock(&state_lock);