aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/exec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/exec.c b/fs/exec.c
index ec5df9a38313..b4e5b8a9216a 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -772,7 +772,6 @@ static int de_thread(struct task_struct *tsk)
772 struct signal_struct *sig = tsk->signal; 772 struct signal_struct *sig = tsk->signal;
773 struct sighand_struct *oldsighand = tsk->sighand; 773 struct sighand_struct *oldsighand = tsk->sighand;
774 spinlock_t *lock = &oldsighand->siglock; 774 spinlock_t *lock = &oldsighand->siglock;
775 struct task_struct *leader = NULL;
776 int count; 775 int count;
777 776
778 if (thread_group_empty(tsk)) 777 if (thread_group_empty(tsk))
@@ -810,7 +809,7 @@ static int de_thread(struct task_struct *tsk)
810 * and to assume its PID: 809 * and to assume its PID:
811 */ 810 */
812 if (!thread_group_leader(tsk)) { 811 if (!thread_group_leader(tsk)) {
813 leader = tsk->group_leader; 812 struct task_struct *leader = tsk->group_leader;
814 813
815 sig->notify_count = -1; /* for exit_notify() */ 814 sig->notify_count = -1; /* for exit_notify() */
816 for (;;) { 815 for (;;) {
@@ -862,8 +861,9 @@ static int de_thread(struct task_struct *tsk)
862 861
863 BUG_ON(leader->exit_state != EXIT_ZOMBIE); 862 BUG_ON(leader->exit_state != EXIT_ZOMBIE);
864 leader->exit_state = EXIT_DEAD; 863 leader->exit_state = EXIT_DEAD;
865
866 write_unlock_irq(&tasklist_lock); 864 write_unlock_irq(&tasklist_lock);
865
866 release_task(leader);
867 } 867 }
868 868
869 sig->group_exit_task = NULL; 869 sig->group_exit_task = NULL;
@@ -872,8 +872,6 @@ static int de_thread(struct task_struct *tsk)
872no_thread_group: 872no_thread_group:
873 exit_itimers(sig); 873 exit_itimers(sig);
874 flush_itimer_signals(); 874 flush_itimer_signals();
875 if (leader)
876 release_task(leader);
877 875
878 if (atomic_read(&oldsighand->count) != 1) { 876 if (atomic_read(&oldsighand->count) != 1) {
879 struct sighand_struct *newsighand; 877 struct sighand_struct *newsighand;