diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-05-09 11:01:07 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-05-09 11:01:07 +0000 |
commit | b99b48e4837ee6f17e2140826c16980ddf836b9b (patch) | |
tree | a0c4d37d1215d31ef5d2b4bc8be8346ac911cc82 /sys/dev/usb/uhci.c | |
parent | c1e4530528edb2bc9995a81e769bc4d655c191bd (diff) |
Plug an xfer leak when detaching root hubs.
This leak is similar to the public xfer leak #1 that was affecting
device interrupt pipes except that root hubs are rarely detached.
Note that this xfer is never associated to any TD and is just used
to indicate that some of the HC ports has changed status, so there
is no need to flag it as "done" before completing it.
Diffstat (limited to 'sys/dev/usb/uhci.c')
-rw-r--r-- | sys/dev/usb/uhci.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/dev/usb/uhci.c b/sys/dev/usb/uhci.c index b720b39eb74..7451e0dca60 100644 --- a/sys/dev/usb/uhci.c +++ b/sys/dev/usb/uhci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uhci.c,v 1.115 2014/05/08 14:00:52 mpi Exp $ */ +/* $OpenBSD: uhci.c,v 1.116 2014/05/09 11:01:06 mpi 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 $ */ @@ -3294,24 +3294,19 @@ uhci_root_ctrl_close(struct usbd_pipe *pipe) DPRINTF(("uhci_root_ctrl_close\n")); } -/* Abort a root interrupt request. */ void uhci_root_intr_abort(struct usbd_xfer *xfer) { struct uhci_softc *sc = (struct uhci_softc *)xfer->device->bus; + int s; timeout_del(&sc->sc_poll_handle); sc->sc_intr_xfer = NULL; - if (xfer->pipe->intrxfer == xfer) { - DPRINTF(("uhci_root_intr_abort: remove\n")); - xfer->pipe->intrxfer = 0; - } xfer->status = USBD_CANCELLED; -#ifdef DIAGNOSTIC - ((struct uhci_xfer *)xfer)->isdone = 1; -#endif + s = splusb(); usb_transfer_complete(xfer); + splx(s); } usbd_status |