diff options
-rw-r--r-- | kernel/kgraft.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/kernel/kgraft.c b/kernel/kgraft.c index 39fa267057174a..395b2c7bd64bb1 100644 --- a/kernel/kgraft.c +++ b/kernel/kgraft.c @@ -152,7 +152,13 @@ static bool kgr_still_patching(void) read_lock(&tasklist_lock); for_each_process_thread(p, t) { - if (klp_kgraft_task_in_progress(t)) { + /* + * Ignore zombie tasks, that is task with ->state == TASK_DEAD. + * We also need to check their ->on_cpu to be sure that they are + * not running any code and they are really almost dead. + */ + if (klp_kgraft_task_in_progress(t) && (t->state != TASK_DEAD || + t->on_cpu != 0)) { failed = true; goto unlock; } |