diff --git a/drivers/usbhost/usbhost_cdcacm.c b/drivers/usbhost/usbhost_cdcacm.c index 260ed25c5fc..4b0a9e5c420 100644 --- a/drivers/usbhost/usbhost_cdcacm.c +++ b/drivers/usbhost/usbhost_cdcacm.c @@ -941,7 +941,7 @@ static void usbhost_txdata_work(FAR void *arg) /* Increment counters and indices */ txndx++; - if (++txtail > txbuf->size) + if (++txtail >= txbuf->size) { txtail = 0; } @@ -1118,7 +1118,6 @@ static void usbhost_rxdata_work(FAR void *arg) * no interest to us. */ - DEBUGASSERT(nread <= priv->pktsize); priv->nrxbytes = (uint16_t)nread; rxndx = 0;