It's not safe to call unregister_task() at this point as
this function might be called from pre_select() or post_select().
Just set the task's error value to -E_TASK_KILLED. The task
will then be unregistered on the next iteration of the
scheduler loop.
if (strcmp(id, buf))
continue;
t->error = -E_TASK_KILLED;
- unregister_task(t);
return 1;
}
list_for_each_entry_safe(t, tmp, &post_select_list, post_select_node) {
if (strcmp(id, buf))
continue;
t->error = -E_TASK_KILLED;
- unregister_task(t);
return 1;
}
return -E_NO_SUCH_TASK;