The 'curr' variable could be NULL and derefrenced by pick_next_entity. Fix this by adding a check that prevent the invocation of pick_next_entity with a NULL passed argument. Addresses-Coverity: ("Explicit null dereferenced") Signed-off-by: Khaled ROMDHANI <khaledromdhani216@xxxxxxxxx> --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 161b92aa1c79..490948df94fe 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -7075,7 +7075,7 @@ static struct task_struct *pick_task_fair(struct rq *rq) else curr = NULL; - if (unlikely(check_cfs_rq_runtime(cfs_rq))) + if (unlikely(check_cfs_rq_runtime(cfs_rq) || !curr)) goto again; } -- 2.17.1