From ad117091cafcfae5cbfdd37ddca727f3b940a8c4 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 15 Dec 2019 13:31:18 +0100 Subject: [PATCH] usb_buf: Actually limit queue to 3 elements, not 4 In Change-ID Ie15183f16b22193ffdaf01845db2eae4c7f43c17 we wanted to limit the number of queue elements to 3, but actually implemented 4. Change-Id: Ic5fb164f2dfd1c293c51bee8184fc34552267a54 --- firmware/libcommon/source/usb_buf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/libcommon/source/usb_buf.c b/firmware/libcommon/source/usb_buf.c index 7892d6eb..b6ecd54c 100644 --- a/firmware/libcommon/source/usb_buf.c +++ b/firmware/libcommon/source/usb_buf.c @@ -80,7 +80,7 @@ int usb_buf_submit(struct msgb *msg) /* no need for irqsafe operation, as the usb_tx_queue is * processed only by the main loop context */ - if (ep->queue_len > USB_MAX_QLEN) { + if (ep->queue_len >= USB_MAX_QLEN) { struct msgb *evict; /* free the first pending buffer in the queue */ TRACE_INFO("EP%02x: dropping first queue element (qlen=%u)\r\n",