summaryrefslogtreecommitdiff
path: root/sys/dev/usb/uhci.c
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2010-12-06 06:09:09 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2010-12-06 06:09:09 +0000
commita1943ecfb9901f009cb1b08eaff4331baf5a6861 (patch)
tree15cc445d9148996872b04adc3ef749bacaff2442 /sys/dev/usb/uhci.c
parent02eb10086e614563bdbef1d69386c6bc91518f18 (diff)
* if we got an undercoverable error, set the dying flag
* check the dying flag in timeout and interrupt handlers fixes crash when disconnecting cardbus usb adapters
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r--sys/dev/usb/uhci.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index ff2ef3e00c1..cfb274ea752 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.87 2010/12/06 05:48:56 jakemsr Exp $ */
+/* $OpenBSD: uhci.c,v 1.88 2010/12/06 06:09:08 jakemsr Exp $ */
/* $NetBSD: uhci.c,v 1.172 2003/02/23 04:19:26 simonb Exp $ */
/* $FreeBSD: src/sys/dev/usb/uhci.c,v 1.33 1999/11/17 22:33:41 n_hibma Exp $ */
@@ -929,6 +929,9 @@ uhci_poll_hub(void *addr)
DPRINTFN(20, ("uhci_poll_hub\n"));
+ if (sc->sc_dying)
+ return;
+
timeout_del(&sc->sc_poll_handle);
timeout_set(&sc->sc_poll_handle, uhci_poll_hub, xfer);
timeout_add(&sc->sc_poll_handle, sc->sc_ival);
@@ -1221,6 +1224,9 @@ uhci_softintr(void *v)
DPRINTFN(10,("%s: uhci_softintr (%d)\n", sc->sc_bus.bdev.dv_xname,
sc->sc_bus.intr_context));
+ if (sc->sc_dying)
+ return;
+
sc->sc_bus.intr_context++;
/*