diff options
-rw-r--r-- | kernel/exit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 92af5cde9bbe..356d91fa095f 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -80,6 +80,7 @@ static void __exit_signal(struct task_struct *tsk) | |||
80 | { | 80 | { |
81 | struct signal_struct *sig = tsk->signal; | 81 | struct signal_struct *sig = tsk->signal; |
82 | struct sighand_struct *sighand; | 82 | struct sighand_struct *sighand; |
83 | struct tty_struct *uninitialized_var(tty); | ||
83 | 84 | ||
84 | BUG_ON(!sig); | 85 | BUG_ON(!sig); |
85 | BUG_ON(!atomic_read(&sig->count)); | 86 | BUG_ON(!atomic_read(&sig->count)); |
@@ -93,6 +94,8 @@ static void __exit_signal(struct task_struct *tsk) | |||
93 | posix_cpu_timers_exit(tsk); | 94 | posix_cpu_timers_exit(tsk); |
94 | if (thread_group_leader(tsk)) { | 95 | if (thread_group_leader(tsk)) { |
95 | posix_cpu_timers_exit_group(tsk); | 96 | posix_cpu_timers_exit_group(tsk); |
97 | tty = sig->tty; | ||
98 | sig->tty = NULL; | ||
96 | } else { | 99 | } else { |
97 | /* | 100 | /* |
98 | * If there is any task waiting for the group exit | 101 | * If there is any task waiting for the group exit |
@@ -147,7 +150,7 @@ static void __exit_signal(struct task_struct *tsk) | |||
147 | * see account_group_exec_runtime(). | 150 | * see account_group_exec_runtime(). |
148 | */ | 151 | */ |
149 | task_rq_unlock_wait(tsk); | 152 | task_rq_unlock_wait(tsk); |
150 | tty_kref_put(sig->tty); | 153 | tty_kref_put(tty); |
151 | } | 154 | } |
152 | } | 155 | } |
153 | 156 | ||