diff options
| -rw-r--r-- | drivers/tty/tty_io.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index d3448a90f0f9..34110719fe03 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -878,9 +878,8 @@ void disassociate_ctty(int on_exit) | |||
| 878 | spin_lock_irq(¤t->sighand->siglock); | 878 | spin_lock_irq(¤t->sighand->siglock); |
| 879 | put_pid(current->signal->tty_old_pgrp); | 879 | put_pid(current->signal->tty_old_pgrp); |
| 880 | current->signal->tty_old_pgrp = NULL; | 880 | current->signal->tty_old_pgrp = NULL; |
| 881 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 882 | 881 | ||
| 883 | tty = get_current_tty(); | 882 | tty = tty_kref_get(current->signal->tty); |
| 884 | if (tty) { | 883 | if (tty) { |
| 885 | unsigned long flags; | 884 | unsigned long flags; |
| 886 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 885 | spin_lock_irqsave(&tty->ctrl_lock, flags); |
| @@ -897,6 +896,7 @@ void disassociate_ctty(int on_exit) | |||
| 897 | #endif | 896 | #endif |
| 898 | } | 897 | } |
| 899 | 898 | ||
| 899 | spin_unlock_irq(¤t->sighand->siglock); | ||
| 900 | /* Now clear signal->tty under the lock */ | 900 | /* Now clear signal->tty under the lock */ |
| 901 | read_lock(&tasklist_lock); | 901 | read_lock(&tasklist_lock); |
| 902 | session_clear_tty(task_session(current)); | 902 | session_clear_tty(task_session(current)); |
