Commit b542b37
committed
Add ready queue dequeue path in mo_task_cancel()
Previously, mo_task_cancel() only removed the task node from the global
task list (kcb->tasks) but did not remove it from the ready queue.
As a result, the scheduler could still select a canceled task that
remained in the ready queue.
Additionally, freeing the node twice could occur because the same node
was already freed after list_remove(), leading to a double-free issue.
This change adds a call to sched_dequeue_task() to remove the task from
the ready queue, ensuring that once a task is canceled, it will no longer
appear in the scheduler’s selection path. This also prevents memory
corruption caused by double-freeing list nodes.1 parent 998986e commit b542b37
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
719 | 725 | | |
720 | 726 | | |
721 | 727 | | |
722 | 728 | | |
723 | 729 | | |
724 | | - | |
725 | 730 | | |
726 | 731 | | |
727 | 732 | | |
| |||
0 commit comments