diff options
author | n_hibma <n_hibma@FreeBSD.org> | 1999-02-21 16:53:35 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 1999-02-21 16:53:35 +0000 |
commit | 1ae726e27b8d33af911a4c53645a414eb5982d32 (patch) | |
tree | 45bcc6655b6b8bc80d2c931c0083860eca4a24c9 /sys/dev/usb/uhub.c | |
parent | 97e0e8232bf6bb3338a482595365e442b0a56381 (diff) | |
download | FreeBSD-src-1ae726e27b8d33af911a4c53645a414eb5982d32.zip FreeBSD-src-1ae726e27b8d33af911a4c53645a414eb5982d32.tar.gz |
Bug fix: Trap 12 when ugen not present and therefore unattached physical
device removed.
Diffstat (limited to 'sys/dev/usb/uhub.c')
-rw-r--r-- | sys/dev/usb/uhub.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/usb/uhub.c b/sys/dev/usb/uhub.c index 04c4054..5749f77 100644 --- a/sys/dev/usb/uhub.c +++ b/sys/dev/usb/uhub.c @@ -456,9 +456,14 @@ uhub_disconnect_port(up) struct softc { /* all softc begin like this */ bdevice sc_dev; }; + struct softc *sc; + struct softc *scp; - struct softc *sc = (struct softc *)dev->softc; - struct softc *scp = (struct softc *)up->parent->softc; + if (!dev) /* no device driver attached at port */ + return; + + sc = (struct softc *)dev->softc; + scp = (struct softc *)up->parent->softc; DPRINTFN(3,("uhub_disconnect_port: up=%p dev=%p port=%d\n", up, dev, up->portno)); |