From 6fb68556db7956f0b93fcb906a4b6d452e5d76ba Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Fri, 9 Aug 2019 16:31:08 +0000 Subject: [PATCH] Fix an assertion that is not always true. It would be nice if we could pass through a parameter specifying whether it should be true for the caller (e.g., ehci non-isoc transfers), but that may be more complicated than it's worth right now. --- sys/dev/usb/usbdi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/usbdi.c b/sys/dev/usb/usbdi.c index 157a4aa2ae5d..5610282b3ca2 100644 --- a/sys/dev/usb/usbdi.c +++ b/sys/dev/usb/usbdi.c @@ -1700,7 +1700,14 @@ usbd_xfer_cancel_timeout_async(struct usbd_xfer *xfer) KASSERT(bus->ub_usepolling || mutex_owned(bus->ub_lock)); - KASSERT(xfer->ux_timeout_set); + /* + * If the timer wasn't running anyway, forget about it. This + * can happen if we are completing an isochronous transfer + * which doesn't use the same timeout logic. + */ + if (!xfer->ux_timeout_set) + return; + xfer->ux_timeout_reset = false; if (!callout_stop(&xfer->ux_callout)) { /*