mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock
@ 2018-03-29 14:43 Jules Maselbas
  2018-03-31 18:52 ` [tip:sched/urgent] sched/cpufreq/schedutil: Fix error path " tip-bot for Jules Maselbas
  0 siblings, 1 reply; 2+ messages in thread
From: Jules Maselbas @ 2018-03-29 14:43 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Peter Zijlstra, Chris Redpath, Patrick Bellasi,
	Dietmar Eggermann, Stephen Kyle, linux-kernel, Jules Maselbas,
	nd

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 <jules.maselbas@arm.com>
---
 kernel/sched/cpufreq_schedutil.c | 3 +--
 1 file changed, 1 insertion(+), 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 @@ 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:
-- 
2.16.2

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-31 18:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 14:43 [PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock Jules Maselbas
2018-03-31 18:52 ` [tip:sched/urgent] sched/cpufreq/schedutil: Fix error path " tip-bot for Jules Maselbas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome