The group_cfs_rq derefrence the 'se' variable that could be passed as NULL pointer. Fix this by adding a check against the sched entity 'se' before the derefrence. Addresses-Coverity: ("Dereference after null check") Signed-off-by: Khaled ROMDHANI <khaledromdhani216@xxxxxxxxx> --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 161b92aa1c79..9be6cdba351d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7080,7 +7080,8 @@ static struct task_struct *pick_task_fair(struct rq *rq) } se = pick_next_entity(cfs_rq, curr); - cfs_rq = group_cfs_rq(se); + if (se) + cfs_rq = group_cfs_rq(se); } while (cfs_rq); return task_of(se); -- 2.17.1