diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2004-08-11 04:07:05 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2004-08-11 04:07:05 +0000 |
commit | 3b5a921823d712d24ec449ce6cb9b617fe6d2858 (patch) | |
tree | 8bf4afb426bf0ae92b1f6f6fe118bb1de2e1e93e /sys/dev | |
parent | e78f5e2c943c3ac9730abba99dfcd234e3fc7f6c (diff) |
from netbsd, ohci.c 1.151
Avoid touching the xfer after calling usb_transfer_complete(), as the
driver callback may have recycled it. From PR 25960.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ohci.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sys/dev/usb/ohci.c b/sys/dev/usb/ohci.c index 21d729b60d5..9b7aa6dd913 100644 --- a/sys/dev/usb/ohci.c +++ b/sys/dev/usb/ohci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ohci.c,v 1.44 2004/08/11 04:05:29 dlg Exp $ */ +/* $OpenBSD: ohci.c,v 1.45 2004/08/11 04:07:04 dlg Exp $ */ /* $NetBSD: ohci.c,v 1.139 2003/02/22 05:24:16 tsutsui Exp $ */ /* $FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $ */ @@ -1454,6 +1454,7 @@ ohci_softintr(void *v) if (uedir == UE_DIR_IN && xfer->status == USBD_NORMAL_COMPLETION) xfer->actlen = actlen; + xfer->hcpriv = NULL; s = splusb(); usb_transfer_complete(xfer); @@ -1482,7 +1483,6 @@ ohci_device_ctrl_done(usbd_xfer_handle xfer) panic("ohci_ctrl_done: not a request"); } #endif - xfer->hcpriv = NULL; } void @@ -1497,8 +1497,6 @@ ohci_device_intr_done(usbd_xfer_handle xfer) DPRINTFN(10,("ohci_intr_done: xfer=%p, actlen=%d\n", xfer, xfer->actlen)); - xfer->hcpriv = NULL; - if (xfer->pipe->repeat) { data = opipe->tail.td; tail = ohci_alloc_std(sc); /* XXX should reuse TD */ @@ -1534,8 +1532,6 @@ ohci_device_bulk_done(usbd_xfer_handle xfer) { DPRINTFN(10,("ohci_bulk_done: xfer=%p, actlen=%d\n", xfer, xfer->actlen)); - - xfer->hcpriv = NULL; } void @@ -1577,13 +1573,11 @@ ohci_rhsc(ohci_softc_t *sc, usbd_xfer_handle xfer) void ohci_root_intr_done(usbd_xfer_handle xfer) { - xfer->hcpriv = NULL; } void ohci_root_ctrl_done(usbd_xfer_handle xfer) { - xfer->hcpriv = NULL; } /* @@ -3387,10 +3381,7 @@ ohci_device_isoc_abort(usbd_xfer_handle xfer) void ohci_device_isoc_done(usbd_xfer_handle xfer) { - DPRINTFN(1,("ohci_device_isoc_done: xfer=%p\n", xfer)); - - xfer->hcpriv = NULL; } usbd_status |