The ->has_child_subreaper code in find_new_reaper() finds alive
"thread" but returns another "reaper" thread which can be dead.

Signed-off-by: Oleg Nesterov <[email protected]>
---
 kernel/exit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/exit.c b/kernel/exit.c
index f773863..31da440 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -512,7 +512,7 @@ static struct task_struct *find_new_reaper(struct 
task_struct *father)
                        thread = reaper;
                        do {
                                if (!(thread->flags & PF_EXITING))
-                                       return reaper;
+                                       return thread;
                        } while_each_thread(reaper, thread);
                }
        }
-- 
1.5.5.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to