summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2004-08-11 04:23:16 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2004-08-11 04:23:16 +0000
commit72c8ea11cf0aa3f0331e9819a7ef88106ad6d701 (patch)
treeffbfb114990ce89c568d5e05f0d614cfd6c5ddd8 /sys/dev/usb
parent07eee5c2a6e5952d49c2dc6530ae9abd3a1690cd (diff)
from netbsd, uhci.c revision 1.178
Interrupt descriptors might become invalid while being processed in uhci_check_intr - so remember their next pointer before calling it.
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/uhci.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c
index 2aed4158471..ae7cdd382f2 100644
--- a/sys/dev/usb/uhci.c
+++ b/sys/dev/usb/uhci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uhci.c,v 1.33 2004/08/11 04:21:44 dlg Exp $ */
+/* $OpenBSD: uhci.c,v 1.34 2004/08/11 04:23:15 dlg 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 $ */
@@ -1259,7 +1259,7 @@ void
uhci_softintr(void *v)
{
uhci_softc_t *sc = v;
- uhci_intr_info_t *ii;
+ uhci_intr_info_t *ii, *nextii;
DPRINTFN(10,("%s: uhci_softintr (%d)\n", USBDEVNAME(sc->sc_bus.bdev),
sc->sc_bus.intr_context));
@@ -1277,8 +1277,10 @@ uhci_softintr(void *v)
* We scan all interrupt descriptors to see if any have
* completed.
*/
- for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = LIST_NEXT(ii, list))
+ for (ii = LIST_FIRST(&sc->sc_intrhead); ii; ii = nextii) {
+ nextii = LIST_NEXT(ii, list);
uhci_check_intr(sc, ii);
+ }
#ifdef USB_USE_SOFTINTR
if (sc->sc_softwake) {