diff --git a/sched/sched/sched_process_delivered.c b/sched/sched/sched_process_delivered.c index fed04e51eadbd..bb90b0cf0eb4d 100644 --- a/sched/sched/sched_process_delivered.c +++ b/sched/sched/sched_process_delivered.c @@ -112,10 +112,11 @@ void nxsched_process_delivered(int cpu) btcb = g_delivertasks[cpu]; - for (next = tcb; - (next && btcb->sched_priority <= next->sched_priority); + for (next = tcb; btcb->sched_priority <= next->sched_priority; next = next->flink); + DEBUGASSERT(next); + prev = next->blink; if (prev == NULL) {