summaryrefslogtreecommitdiffstats
path: root/debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch')
-rw-r--r--debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch34
1 files changed, 34 insertions, 0 deletions
diff --git a/debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch b/debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch
new file mode 100644
index 000000000..bc78d7729
--- /dev/null
+++ b/debian/patches-rt/0021-sched-Unlock-the-rq-in-affine_move_task-error-path.patch
@@ -0,0 +1,34 @@
+From 9a34ae4ec3b4af5cc98c8405ea590096a1380af9 Mon Sep 17 00:00:00 2001
+From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Date: Mon, 9 Nov 2020 15:54:03 +0100
+Subject: [PATCH 021/323] sched: Unlock the rq in affine_move_task() error path
+Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/5.10/older/patches-5.10.204-rt100.tar.xz
+
+Unlock the rq if returned early in the error path.
+
+Reported-by: Joe Korty <joe.korty@concurrent-rt.com>
+Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Link: https://lkml.kernel.org/r/20201106203921.GA48461@zipoli.concurrent-rt.com
+---
+ kernel/sched/core.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/sched/core.c b/kernel/sched/core.c
+index 565d8011c832..d12d91510789 100644
+--- a/kernel/sched/core.c
++++ b/kernel/sched/core.c
+@@ -2228,8 +2228,10 @@ static int affine_move_task(struct rq *rq, struct task_struct *p, struct rq_flag
+ *
+ * Either way, we really should have a @pending here.
+ */
+- if (WARN_ON_ONCE(!pending))
++ if (WARN_ON_ONCE(!pending)) {
++ task_rq_unlock(rq, p, rf);
+ return -EINVAL;
++ }
+
+ if (flags & SCA_MIGRATE_ENABLE) {
+
+--
+2.43.0
+