From 153dbd2495d96e57df60560b9b912cbb6305fd93 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Wed, 24 May 2023 18:25:34 +0200 Subject: [PATCH] usbus: don't trigger assertion in usbus_urb_submit() --- sys/usb/usbus/usbus.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/usb/usbus/usbus.c b/sys/usb/usbus/usbus.c index a584fa55f3..746b41bddd 100644 --- a/sys/usb/usbus/usbus.c +++ b/sys/usb/usbus/usbus.c @@ -282,7 +282,11 @@ static void _usbus_transfer_urb_submit(usbus_endpoint_t *usbus_ep, void usbus_urb_submit(usbus_t *usbus, usbus_endpoint_t *endpoint, usbus_urb_t *urb) { (void)usbus; - assert(!(clist_find(&endpoint->urb_list, &urb->list))); + + if (clist_find(&endpoint->urb_list, &urb->list)) { + return; + } + if (endpoint->ep->dir == USB_EP_DIR_IN && ((urb->len % endpoint->maxpacketsize) == 0) && usbus_urb_isset_flag(urb, USBUS_URB_FLAG_AUTO_ZLP)) {