Commit 7171771
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 bde4e35 commit 7171771
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
724 | 730 | | |
725 | 731 | | |
726 | 732 | | |
727 | 733 | | |
728 | 734 | | |
729 | | - | |
730 | 735 | | |
731 | 736 | | |
732 | 737 | | |
| |||
0 commit comments