Commit 300420722e0734a4254f3b634e0f82664495d210
Committed by
Greg Kroah-Hartman
1 parent
df92d0561d
Exists in
master
and in
6 other branches
TTY: ldisc, move wait idle to caller
It is the only place where reinit is called from. And we really need to wait for the old ldisc to go once. Actually this is the place where the waiting originally was (before removed and re-added later). This will make the fix in the following patch easier to implement. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Dave Young <hidave.darkstar@gmail.com> Cc: Dave Jones <davej@redhat.com> Cc: Ben Hutchings <ben@decadent.org.uk> Cc: Dmitriy Matrosov <sgf.dma@gmail.com> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/tty/tty_ldisc.c
... | ... | @@ -763,8 +763,6 @@ |
763 | 763 | if (IS_ERR(ld)) |
764 | 764 | return -1; |
765 | 765 | |
766 | - WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ)); | |
767 | - | |
768 | 766 | tty_ldisc_close(tty, tty->ldisc); |
769 | 767 | tty_ldisc_put(tty->ldisc); |
770 | 768 | tty->ldisc = NULL; |
... | ... | @@ -848,6 +846,8 @@ |
848 | 846 | it means auditing a lot of other paths so this is |
849 | 847 | a FIXME */ |
850 | 848 | if (tty->ldisc) { /* Not yet closed */ |
849 | + WARN_ON_ONCE(tty_ldisc_wait_idle(tty, 5 * HZ)); | |
850 | + | |
851 | 851 | if (reset == 0) { |
852 | 852 | |
853 | 853 | if (!tty_ldisc_reinit(tty, tty->termios->c_line)) |