diff options
author | jhb <jhb@FreeBSD.org> | 2004-12-30 19:24:49 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2004-12-30 19:24:49 +0000 |
commit | a610dc93b76ce2560e83731cc4e56baa53fcfe13 (patch) | |
tree | 18efb5abe05520546c68b17d2eab7cdb22195139 /sys/kern/tty.c | |
parent | e11d37605f77e847e323ee1bb319f9dec4c4e801 (diff) | |
download | FreeBSD-src-a610dc93b76ce2560e83731cc4e56baa53fcfe13.zip FreeBSD-src-a610dc93b76ce2560e83731cc4e56baa53fcfe13.tar.gz |
Call tty_close() at the very end of ttyclose() since otherwise NULL
deferences can occur since tty_close() may end up freeing the tty structure
if it drops the last reference to it.
Glanced at by: phk
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index ddf26b5..15df71c 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -3172,10 +3172,10 @@ ttyclose(struct cdev *dev, int flag, int mode, struct thread *td) ttyldoptim(tp); if (tp->t_close != NULL) tp->t_close(tp); - tty_close(tp); tp->t_do_timestamp = 0; if (tp->t_pps != NULL) tp->t_pps->ppsparam.mode = 0; + tty_close(tp); return (0); } |