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;