diff options
author | Jules Maselbas <jules.maselbas@arm.com> | 2018-03-29 10:43:01 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2018-03-31 14:42:38 -0400 |
commit | 1b5d43cfb69759d8ef8d30469cea31d0c037aed5 (patch) | |
tree | 8845496f34fe5c69de448b1dd703d0d9bdc50d34 /kernel | |
parent | b5dbc28762fd3fd40ba76303be0c7f707826f982 (diff) |
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 <jules.maselbas@arm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Chris Redpath <chris.redpath@arm.com>
Cc: Dietmar Eggermann <dietmar.eggemann@arm.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Patrick Bellasi <patrick.bellasi@arm.com>
Cc: Stephen Kyle <stephen.kyle@arm.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Cc: nd@arm.com
Link: http://lkml.kernel.org/r/20180329144301.38419-1-jules.maselbas@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sched/cpufreq_schedutil.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 7936f548e071..617c6741c525 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
@@ -625,10 +625,9 @@ fail: | |||
625 | 625 | ||
626 | stop_kthread: | 626 | stop_kthread: |
627 | sugov_kthread_stop(sg_policy); | 627 | sugov_kthread_stop(sg_policy); |
628 | |||
629 | free_sg_policy: | ||
630 | mutex_unlock(&global_tunables_lock); | 628 | mutex_unlock(&global_tunables_lock); |
631 | 629 | ||
630 | free_sg_policy: | ||
632 | sugov_policy_free(sg_policy); | 631 | sugov_policy_free(sg_policy); |
633 | 632 | ||
634 | disable_fast_switch: | 633 | disable_fast_switch: |