summaryrefslogtreecommitdiffstats
path: root/sys/dev/sio/sio.c
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2004-07-22 23:16:12 +0000
committerimp <imp@FreeBSD.org>2004-07-22 23:16:12 +0000
commit5f9a1d08785739f2f018ea92ebc54de2cf0b1e29 (patch)
treed47d6a098c241e8cb72b329274ce38a905e73145 /sys/dev/sio/sio.c
parentf3c3c8c6c51a836f82aa9a8111b29eaeac7c3645 (diff)
downloadFreeBSD-src-5f9a1d08785739f2f018ea92ebc54de2cf0b1e29.zip
FreeBSD-src-5f9a1d08785739f2f018ea92ebc54de2cf0b1e29.tar.gz
If you insert a pccard modem and then eject it, you get a panic. This
happens because the sio device was never opened and com->tp is therefore NULL. ttygone can't swallow a NULL, so guard against that possibility. Other places in this function make similar checks, so I believe this is correct.
Diffstat (limited to 'sys/dev/sio/sio.c')
-rw-r--r--sys/dev/sio/sio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/sio/sio.c b/sys/dev/sio/sio.c
index f9086db..fae045f 100644
--- a/sys/dev/sio/sio.c
+++ b/sys/dev/sio/sio.c
@@ -454,7 +454,8 @@ siodetach(dev)
return (0);
}
com->gone = TRUE;
- ttygone(com->tp);
+ if (com->tp)
+ ttygone(com->tp);
for (i = 0 ; i < 6; i++)
destroy_dev(com->devs[i]);
if (com->irqres) {
OpenPOWER on IntegriCloud