From: Jules Maselbas <jules.maselbas@arm.com>
To: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
Chris Redpath <chris.redpath@arm.com>,
Patrick Bellasi <patrick.bellasi@arm.com>,
Dietmar Eggermann <dietmar.eggemann@arm.com>,
Stephen Kyle <stephen.kyle@arm.com>,
linux-kernel@vger.kernel.org,
Jules Maselbas <jules.maselbas@arm.com>,
nd@arm.com
Subject: [PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock
Date: Thu, 29 Mar 2018 15:43:01 +0100 [thread overview]
Message-ID: <20180329144301.38419-1-jules.maselbas@arm.com> (raw)
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
next reply other threads:[~2018-03-29 14:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 14:43 Jules Maselbas [this message]
2018-03-31 18:52 ` [tip:sched/urgent] sched/cpufreq/schedutil: Fix error path " tip-bot for Jules Maselbas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180329144301.38419-1-jules.maselbas@arm.com \
--to=jules.maselbas@arm.com \
--cc=chris.redpath@arm.com \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nd@arm.com \
--cc=patrick.bellasi@arm.com \
--cc=peterz@infradead.org \
--cc=stephen.kyle@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®