Page MenuHomeFreeBSD

D57401.1794349947.diff
No OneTemporary

Authored By
Unknown
Size
955 B
Referenced Files
None
Subscribers
None

D57401.1794349947.diff

diff --git a/sys/kern/tty.c b/sys/kern/tty.c
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -320,13 +320,23 @@
tp->t_termios = tp->t_termios_init_out;
else
tp->t_termios = tp->t_termios_init_in;
- ttydevsw_param(tp, &tp->t_termios);
+ (void)ttydevsw_param(tp, &tp->t_termios);
+ if (tty_gone(tp)) {
+ error = ENXIO;
+ goto done;
+ }
+
/* Prevent modem control on callout devices and /dev/console. */
if (TTY_CALLOUT(tp, dev) || dev == dev_console)
tp->t_termios.c_cflag |= CLOCAL;
if ((tp->t_termios.c_cflag & CNO_RTSDTR) == 0)
- ttydevsw_modem(tp, SER_DTR|SER_RTS, 0);
+ (void)ttydevsw_modem(tp, SER_DTR|SER_RTS, 0);
+
+ if (tty_gone(tp)) {
+ error = ENXIO;
+ goto done;
+ }
error = ttydevsw_open(tp);
if (error != 0)
@@ -348,6 +358,11 @@
}
}
+ if (tty_gone(tp)) {
+ error = ENXIO;
+ goto done;
+ }
+
if (dev == dev_console)
tp->t_flags |= TF_OPENED_CONS;
else if (TTY_CALLOUT(tp, dev))

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 10, 10:32 PM (20 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41647898
Default Alt Text
D57401.1794349947.diff (955 B)

Event Timeline