From b4de080b1f08fc4e5c73c3d5422739b52a099e77 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 a7e6260ba6..5859a143d5 100644 --- a/drivers/usbdev/cdcacm.c +++ b/drivers/usbdev/cdcacm.c @@ -990,7 +990,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;