]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
exit signals: use of uninitialized field notify_count
authorSteve VanDeBogart <vandebo-lkml@NerdBox.Net>
Tue, 26 Aug 2008 22:14:36 +0000 (15:14 -0700)
committerIngo Molnar <mingo@elte.hu>
Wed, 27 Aug 2008 07:10:09 +0000 (09:10 +0200)
task->signal->notify_count is only initialized if
task->signal->group_exit_task is not NULL.  Reorder a conditional so
that uninitialised memory is not used.  Found by Valgrind.

Signed-off-by: Steve VanDeBogart <vandebo-lkml@nerdbox.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/exit.c

index 38ec40630149bd07b97f06d406d9398763a6de8c..75c6473876394f7a1956908fe0bb423f5e5536f7 100644 (file)
@@ -918,8 +918,8 @@ static void exit_notify(struct task_struct *tsk, int group_dead)
 
        /* mt-exec, de_thread() is waiting for us */
        if (thread_group_leader(tsk) &&
-           tsk->signal->notify_count < 0 &&
-           tsk->signal->group_exit_task)
+           tsk->signal->group_exit_task &&
+           tsk->signal->notify_count < 0)
                wake_up_process(tsk->signal->group_exit_task);
 
        write_unlock_irq(&tasklist_lock);