os/wqueue : Check underflow in remaining time
If 'elapsed' is greater than 'cur_work->delay', there is an underflow.
So It must check.
@@ -146,7 +146,7 @@ int work_qqueue(FAR struct wqueue_s *wqueue, FAR struct work_s *work, worker_t w
if (next_work == NULL) {
elapsed = ctick - cur_work->qtime;
- if (cur_work->delay - elapsed > delay) {
+ if (cur_work->delay > elapsed && cur_work->delay - elapsed > delay) {
next_work = cur_work;
}
}
