From 3fbfc998c9328fe526deded1a7d6f239431d081d Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Tue, 2 Nov 2021 09:30:31 -0700 Subject: [PATCH] walt_lb: Read push_task under lock push_task assignment is guarded by corresponding runqueue's lock. Read it only when lock is acquired. Change-Id: I74668df66b4e18286b919b136d912a3f8afda11c Signed-off-by: Elliot Berman Signed-off-by: Sai Harshini Nimmala --- kernel/sched/walt/walt_lb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/walt/walt_lb.c b/kernel/sched/walt/walt_lb.c index 20adabaf92c4..46f1cbd82392 100644 --- a/kernel/sched/walt/walt_lb.c +++ b/kernel/sched/walt/walt_lb.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2020-2021, Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -39,10 +40,11 @@ static int walt_lb_active_migration(void *data) int target_cpu = busiest_rq->push_cpu; struct rq *target_rq = cpu_rq(target_cpu); struct walt_rq *wrq = (struct walt_rq *) busiest_rq->android_vendor_data1; - struct task_struct *push_task = wrq->push_task; + struct task_struct *push_task; int push_task_detached = 0; raw_spin_lock_irq(&busiest_rq->__lock); + push_task = wrq->push_task; /* sanity checks before initiating the pull */ if (!cpu_active(busiest_cpu) || !cpu_active(target_cpu) || !push_task)