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>] [day] [month] [year] [list]
Message-ID: <20200928152205.GA17900@rlk>
Date:   Mon, 28 Sep 2020 23:22:05 +0800
From:   Hui Su <sh_def@....com>
To:     mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        linux-kernel@...r.kernel.org
Subject: [PATCH] sched/rt.c: handle exceptions gracefully

handle exceptions gracefully, and avoid using
if (0) .

Signed-off-by: Hui Su <sh_def@....com>
---
 kernel/sched/rt.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c
index f215eea6a966..1dd6cbd67e6e 100644
--- a/kernel/sched/rt.c
+++ b/kernel/sched/rt.c
@@ -2753,14 +2753,15 @@ int sched_rt_handler(struct ctl_table *table, int write, void *buffer,
 		sched_rt_do_global();
 		sched_dl_do_global();
 	}
-	if (0) {
-undo:
-		sysctl_sched_rt_period = old_period;
-		sysctl_sched_rt_runtime = old_runtime;
-	}
-	mutex_unlock(&mutex);
 
+out:
+	mutex_unlock(&mutex);
 	return ret;
+
+undo:
+	sysctl_sched_rt_period = old_period;
+	sysctl_sched_rt_runtime = old_runtime;
+	goto out;
 }
 
 int sched_rr_handler(struct ctl_table *table, int write, void *buffer,
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ