From 5132ecf659d4b578dd14181c8a7de043dbc6807a Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 1 Apr 2008 21:55:26 +0200 Subject: [PATCH] kill_task(): Only set task error status. 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. --- sched.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sched.c b/sched.c index 5f7babe7..25004060 100644 --- a/sched.c +++ b/sched.c @@ -236,7 +236,6 @@ int kill_task(char *id) 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) { @@ -244,7 +243,6 @@ int kill_task(char *id) if (strcmp(id, buf)) continue; t->error = -E_TASK_KILLED; - unregister_task(t); return 1; } return -E_NO_SUCH_TASK; -- 2.39.5