diff options
author | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2004-09-20 13:55:26 +0000 |
---|---|---|
committer | Yoshihiro Takahashi <nyan@FreeBSD.org> | 2004-09-20 13:55:26 +0000 |
commit | 31eac965cd6d38a4f46b717a4cd430bb8d50f3cf (patch) | |
tree | e6bdb65e3e4e4a0a5c535b56111243b0c90c9fe1 | |
parent | 4acce4f8debe2dfc336176bfe33b896de4254d85 (diff) |
Notes
-rw-r--r-- | sys/dev/sio/sio.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c index 9fbfad8b7874..f477d73c1b5f 100644 --- a/sys/dev/sio/sio.c +++ b/sys/dev/sio/sio.c @@ -393,6 +393,9 @@ sysctl_machdep_comdefaultrate(SYSCTL_HANDLER_ARGS) return (ENXIO); tp = com->tp; + if (tp == NULL) + return (ENXIO); + /* * set the initial and lock rates for /dev/ttydXX and /dev/cuaXX * (note, the lock rates really are boolean -- if non-zero, disallow @@ -406,7 +409,7 @@ sysctl_machdep_comdefaultrate(SYSCTL_HANDLER_ARGS) /* * if we're open, change the running rate too */ - if (tp && (tp->t_state & TS_ISOPEN)) { + if (tp->t_state & TS_ISOPEN) { tp->t_termios.c_ispeed = tp->t_termios.c_ospeed = comdefaultrate; s = spltty(); @@ -1405,11 +1408,9 @@ sioclose(dev, flag, mode, td) struct thread *td; { struct com_s *com; - int mynor; int s; struct tty *tp; - mynor = minor(dev); com = dev->si_drv1; if (com == NULL) return (ENODEV); |