diff options
author | csjp <csjp@FreeBSD.org> | 2008-09-10 20:12:10 +0000 |
---|---|---|
committer | csjp <csjp@FreeBSD.org> | 2008-09-10 20:12:10 +0000 |
commit | 1fa65beb809920dc3aac7a66e3f88768d0da285d (patch) | |
tree | 7668cd885a931d5f7779ec8ff48bcbaecb4c2efa /sys/kern/tty_ttydisc.c | |
parent | 5f92bd8a2360a9a7bab3592599efa577544cf5d7 (diff) | |
download | FreeBSD-src-1fa65beb809920dc3aac7a66e3f88768d0da285d.zip FreeBSD-src-1fa65beb809920dc3aac7a66e3f88768d0da285d.tar.gz |
Make sure the TTY has not disappeared out from under us before calling
ttydevsw_outwakeup(). This should fix panics which occur after remote
login sessions timeout during moderate TTY activity. An example of
where this might occur is where a pending write to the terminal is
occurring while sshd(8) is shutting down the TTY after a TCP timeout.
Submitted by: ed
Diffstat (limited to 'sys/kern/tty_ttydisc.c')
-rw-r--r-- | sys/kern/tty_ttydisc.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/tty_ttydisc.c b/sys/kern/tty_ttydisc.c index 1bcdfd6..21c029b 100644 --- a/sys/kern/tty_ttydisc.c +++ b/sys/kern/tty_ttydisc.c @@ -539,8 +539,9 @@ ttydisc_write(struct tty *tp, struct uio *uio, int ioflag) } while (oblen > 0); } -done: - ttydevsw_outwakeup(tp); +done: + if (!tty_gone(tp)) + ttydevsw_outwakeup(tp); /* * Add the amount of bytes that we didn't process back to the |