public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Jules Maselbas <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, dietmar.eggemann@arm.com,
	linux-kernel@vger.kernel.org, stephen.kyle@arm.com,
	jules.maselbas@arm.com, hpa@zytor.com, patrick.bellasi@arm.com,
	torvalds@linux-foundation.org, chris.redpath@arm.com,
	mingo@kernel.org, efault@gmx.de, tglx@linutronix.de
Subject: [tip:sched/urgent] sched/cpufreq/schedutil: Fix error path mutex unlock
Date: Sat, 31 Mar 2018 11:52:20 -0700	[thread overview]
Message-ID: <tip-1b5d43cfb69759d8ef8d30469cea31d0c037aed5@git.kernel.org> (raw)
In-Reply-To: <20180329144301.38419-1-jules.maselbas@arm.com>

Commit-ID:  1b5d43cfb69759d8ef8d30469cea31d0c037aed5
Gitweb:     https://git.kernel.org/tip/1b5d43cfb69759d8ef8d30469cea31d0c037aed5
Author:     Jules Maselbas <jules.maselbas@arm.com>
AuthorDate: Thu, 29 Mar 2018 15:43:01 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 31 Mar 2018 20:42:38 +0200

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>
---
 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 @@ fail:
 
 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:

      reply	other threads:[~2018-03-31 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-29 14:43 [PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock Jules Maselbas
2018-03-31 18:52 ` tip-bot for Jules Maselbas [this message]

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=tip-1b5d43cfb69759d8ef8d30469cea31d0c037aed5@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=chris.redpath@arm.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=efault@gmx.de \
    --cc=hpa@zytor.com \
    --cc=jules.maselbas@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=patrick.bellasi@arm.com \
    --cc=peterz@infradead.org \
    --cc=stephen.kyle@arm.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    /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