* [PATCH] sched/rt.c: handle exceptions gracefully
@ 2020-09-28 15:22 Hui Su
0 siblings, 0 replies; only message in thread
From: Hui Su @ 2020-09-28 15:22 UTC (permalink / raw)
To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
rostedt, bsegall, mgorman, linux-kernel
handle exceptions gracefully, and avoid using
if (0) .
Signed-off-by: Hui Su <sh_def@163.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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-28 15:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-28 15:22 [PATCH] sched/rt.c: handle exceptions gracefully Hui Su
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox