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:
parent
2830b6d0c9
commit
3a1979a9e8
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue