From c18ab1d16287c289a418c2e29fdf3fb0673cb5e9 Mon Sep 17 00:00:00 2001 From: Pavankumar Kondeti Date: Wed, 7 Apr 2021 09:37:15 +0530 Subject: [PATCH] ANDROID: sched: Initialize arguments of android_rvh_replace_next_task_fair android_rvh_replace_next_task_fair() hooks allows vendor modules to replace the next task selected by the CFS. There are two cases in how this hook is called. 1. When the previous task is also a CFS task. In this case, the task_struct (p) and sched_entity (se) arguments passed to this hook are valid and point to the task selected by the CFS. 2. When the previous task is not a CFS task. In this case, the arguments passed to this hook are not initialized. Initialize these arguments to NULL which allows vendor modules when not to peek into the selected task by CFS. Bug: 184695001 Change-Id: Ib51dacb607663a2a6434e49198f59b36fb8c9312 Signed-off-by: Pavankumar Kondeti --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 72a065c74550..43face3519a9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7117,8 +7117,8 @@ struct task_struct * pick_next_task_fair(struct rq *rq, struct task_struct *prev, struct rq_flags *rf) { struct cfs_rq *cfs_rq = &rq->cfs; - struct sched_entity *se; - struct task_struct *p; + struct sched_entity *se = NULL; + struct task_struct *p = NULL; int new_tasks; bool repick = false;