Skip to content

Commit

Permalink
sched/cpufreq/schedutil: Fix error path mutex unlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jules Maselbas authored and Ingo Molnar committed Mar 31, 2018
1 parent b5dbc28 commit 1b5d43c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions kernel/sched/cpufreq_schedutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1b5d43c

Please sign in to comment.