opened with a callback.
If a driver opens an interrupt pipe without callback function, like
umct(4) does with one of its bulk in endpoints being reported as an
interrupt endpoint, then we can end up aborting a transfer which is
different from the interrupt one.
Issue reported by Roberto E. Vargas Caballero, ok deraadt@
-/* $OpenBSD: ehci.c,v 1.163 2014/08/03 14:30:28 jsg Exp $ */
+/* $OpenBSD: ehci.c,v 1.164 2014/08/05 20:26:15 mpi Exp $ */
/* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */
/*
void
ehci_device_intr_abort(struct usbd_xfer *xfer)
{
- KASSERT(xfer->pipe->intrxfer == xfer);
+ KASSERT(!xfer->pipe->repeat || xfer->pipe->intrxfer == xfer);
/*
* XXX - abort_xfer uses ehci_sync_hc, which syncs via the advance
-/* $OpenBSD: ohci.c,v 1.136 2014/07/12 20:13:48 mpi Exp $ */
+/* $OpenBSD: ohci.c,v 1.137 2014/08/05 20:26:15 mpi 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 $ */
void
ohci_device_intr_abort(struct usbd_xfer *xfer)
{
- KASSERT(xfer->pipe->intrxfer == xfer);
+ KASSERT(!xfer->pipe->repeat || xfer->pipe->intrxfer == xfer);
ohci_abort_xfer(xfer, USBD_CANCELLED);
}
-/* $OpenBSD: uhci.c,v 1.128 2014/07/12 20:13:48 mpi Exp $ */
+/* $OpenBSD: uhci.c,v 1.129 2014/08/05 20:26:15 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 $ */
void
uhci_device_intr_abort(struct usbd_xfer *xfer)
{
- KASSERT(xfer->pipe->intrxfer == xfer);
+ KASSERT(!xfer->pipe->repeat || xfer->pipe->intrxfer == xfer);
uhci_abort_xfer(xfer, USBD_CANCELLED);
}