cpufreq: schedutil: Prevent unnecessary mutex unlock
Subsystems (2)
PATCH 1/1 cpufreq: schedutil: Prevent unnecessary mutex unlock
This patch prevents the mutex global_tunables_lock from being unlocked before being locked. This mutex is not locked if the function sugov_kthread_create fails.
Signed-off-by Jules Maselbas <[email protected]>
--- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/sched/cpufreq_schedutil.c +1 -2
@@ -625,10 +625,9 @@ static int sugov_init(struct cpufreq_policy *policy) stop_kthread:sugov_kthread_stop (sg_policy); - -free_sg_policy:mutex_unlock (&global_tunables_lock); +free_sg_policy:sugov_policy_free (sg_policy); disable_fast_switch:
Signature · 1 line
2.16.2
tip-bot for Jules Maselbas
merge bot[tip:sched/urgent] sched/cpufreq/schedutil: Fix error path mutex unlock
sched/cpufreq/schedutil: Fix error path mutex unlock
Commit-ID: 1b5d43cfb69759d8ef8d30469cea31d0c037aed5 Gitweb: https://git.kernel.org/tip/1b5d43cfb69759d8ef8d30469cea31d0c037aed5 Author: Jules Maselbas <[email protected]> AuthorDate: Thu, 29 Mar 2018 15:43:01 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 31 Mar 2018 20:42:38 +0200
sched/cpufreq/schedutil: Fix error path mutex unlock
This patch prevents the 'global_tunables_lock' mutex from being unlocked before being locked. This mutex is not locked if the sugov_kthread_create() function fails.
Signed-off-by Jules Maselbas <[email protected]>
Acked-by Peter Zijlstra <[email protected]>
Cc Chris Redpath <[email protected]>
Cc Dietmar Eggermann <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Mike Galbraith <[email protected]>
Cc Patrick Bellasi <[email protected]>
Cc Stephen Kyle <[email protected]>
Cc Thomas Gleixner <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/sched/cpufreq_schedutil.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
kernel/sched/cpufreq_schedutil.c +1 -2
@@ -625,10 +625,9 @@ fail: stop_kthread:sugov_kthread_stop (sg_policy); - -free_sg_policy:mutex_unlock (&global_tunables_lock); +free_sg_policy:sugov_policy_free (sg_policy); disable_fast_switch: