Skip to content

Commit

Permalink
exit signals: use of uninitialized field notify_count
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Steve VanDeBogart authored and Ingo Molnar committed Aug 27, 2008
1 parent 7487017 commit 2633f0e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 2633f0e

Please sign in to comment.