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;