From 9a34ae4ec3b4af5cc98c8405ea590096a1380af9 Mon Sep 17 00:00:00 2001 From: Sebastian Andrzej Siewior 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 Signed-off-by: Sebastian Andrzej Siewior 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