From a1f7d4579fe785f878d78c98b9887fc64dca7d59 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 57b658d28e946..cdff3e750375e 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;