drivers/usbdev/cdcacm.c: fix check priv->nwrq issue

When enable CONFIG_CDCACM_DISABLE_TXBUF, dev->xmit.buffer always
take one req, so just compare CONFIG_CDCACM_NWRREQS - 1.

Signed-off-by: yangsong8 <yangsong8@xiaomi.com>
This commit is contained in:
yangsong8
2025-05-06 21:17:54 +08:00
committed by Xiang Xiao
parent e78e152cc7
commit fe293ec9b5
+5
View File
@@ -1485,7 +1485,12 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
*/
flags = enter_critical_section();
#ifdef CONFIG_CDCACM_DISABLE_TXBUF
DEBUGASSERT(priv->nwrq >= CONFIG_CDCACM_NWRREQS - 1);
#else
DEBUGASSERT(priv->nwrq == CONFIG_CDCACM_NWRREQS);
#endif
while (!sq_empty(&priv->txfree))
{