summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2004-09-20 13:55:26 +0000
committernyan <nyan@FreeBSD.org>2004-09-20 13:55:26 +0000
commit7851aaef7291db71f1be413ed0654ecff74e3696 (patch)
treee6bdb65e3e4e4a0a5c535b56111243b0c90c9fe1 /sys/dev/sio
parent9d5a60849aba217ad84939bc097b4d9a01f936be (diff)
downloadFreeBSD-src-7851aaef7291db71f1be413ed0654ecff74e3696.zip
FreeBSD-src-7851aaef7291db71f1be413ed0654ecff74e3696.tar.gz
MFpc98: Check a pointer is NULL, remove unused variable.
Diffstat (limited to 'sys/dev/sio')
-rw-r--r--sys/dev/sio/sio.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index 9fbfad8..f477d73 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);
OpenPOWER on IntegriCloud