From 3775fe736924dd2e4c50728e0af4fc51d8166790 Mon Sep 17 00:00:00 2001 From: Jouni Ukkonen Date: Mon, 7 Oct 2024 08:41:09 +0300 Subject: [PATCH] usbdev/cdcacm: Fix read queue counter in shutdown nrdq is already set 0 in resetconfig. Signed-off-by: Jouni Ukkonen --- drivers/usbdev/cdcacm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usbdev/cdcacm.c b/drivers/usbdev/cdcacm.c index efffdd1a49048..0e52ae599f2d3 100644 --- a/drivers/usbdev/cdcacm.c +++ b/drivers/usbdev/cdcacm.c @@ -1125,7 +1125,10 @@ static void cdcacm_rdcomplete(FAR struct usbdev_ep_s *ep, case -ESHUTDOWN: /* Disconnection */ { usbtrace(TRACE_CLSERROR(USBSER_TRACEERR_RDSHUTDOWN), 0); - priv->nrdq--; + if (priv->nrdq != 0) + { + priv->nrdq--; + } } break;