lkml.org 
[lkml]   [2018]   [Mar]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock
Date
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
\
 
 \ /
  Last update: 2018-03-29 16:43    [W:0.033 / U:0.192 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site