From 5f9a1d08785739f2f018ea92ebc54de2cf0b1e29 Mon Sep 17 00:00:00 2001 From: imp Date: Thu, 22 Jul 2004 23:16:12 +0000 Subject: 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. --- sys/dev/sio/sio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/dev/sio/sio.c') 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) { -- cgit v1.1