Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0a9c8a31 authored by Junjie Wu's avatar Junjie Wu
Browse files

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: default avatarJunjie Wu <junjiew@codeaurora.org>
parent 07c7432a
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -242,7 +242,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,
@@ -265,9 +265,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);