lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 29 Mar 2018 15:43:01 +0100
From:   Jules Maselbas <jules.maselbas@....com>
To:     Ingo Molnar <mingo@...hat.com>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        Chris Redpath <chris.redpath@....com>,
        Patrick Bellasi <patrick.bellasi@....com>,
        Dietmar Eggermann <dietmar.eggemann@....com>,
        Stephen Kyle <stephen.kyle@....com>,
        linux-kernel@...r.kernel.org,
        Jules Maselbas <jules.maselbas@....com>, nd@....com
Subject: [PATCH] cpufreq: schedutil: Prevent unnecessary mutex unlock

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@....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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ