diff options
Diffstat (limited to 'drivers/tty/tty_io.c')
-rw-r--r-- | drivers/tty/tty_io.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index 3feca406dc36..d3ddb31e363e 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
@@ -651,17 +651,17 @@ static void __tty_hangup(struct tty_struct *tty, int exit_session) | |||
651 | } | 651 | } |
652 | spin_unlock(&tty_files_lock); | 652 | spin_unlock(&tty_files_lock); |
653 | 653 | ||
654 | refs = tty_signal_session_leader(tty, exit_session); | ||
655 | /* Account for the p->signal references we killed */ | ||
656 | while (refs--) | ||
657 | tty_kref_put(tty); | ||
658 | |||
654 | /* | 659 | /* |
655 | * it drops BTM and thus races with reopen | 660 | * it drops BTM and thus races with reopen |
656 | * we protect the race by TTY_HUPPING | 661 | * we protect the race by TTY_HUPPING |
657 | */ | 662 | */ |
658 | tty_ldisc_hangup(tty); | 663 | tty_ldisc_hangup(tty); |
659 | 664 | ||
660 | refs = tty_signal_session_leader(tty, exit_session); | ||
661 | /* Account for the p->signal references we killed */ | ||
662 | while (refs--) | ||
663 | tty_kref_put(tty); | ||
664 | |||
665 | spin_lock_irq(&tty->ctrl_lock); | 665 | spin_lock_irq(&tty->ctrl_lock); |
666 | clear_bit(TTY_THROTTLED, &tty->flags); | 666 | clear_bit(TTY_THROTTLED, &tty->flags); |
667 | clear_bit(TTY_PUSH, &tty->flags); | 667 | clear_bit(TTY_PUSH, &tty->flags); |