mirror of
https://github.com/apache/nuttx.git
synced 2026-06-01 07:45:16 +08:00
drivers/usbdev: Move test for NULL pointer before the pointer is deferences. Noted by Juha Niskanen.
This commit is contained in:
@@ -480,10 +480,11 @@ static int cdcacm_recvpacket(FAR struct cdcacm_dev_s *priv,
|
|||||||
uint16_t nexthead;
|
uint16_t nexthead;
|
||||||
uint16_t nbytes = 0;
|
uint16_t nbytes = 0;
|
||||||
|
|
||||||
|
DEBUGASSERT(priv != NULL && rdcontainer != NULL);
|
||||||
|
|
||||||
uinfo("head=%d tail=%d nrdq=%d reqlen=%d\n",
|
uinfo("head=%d tail=%d nrdq=%d reqlen=%d\n",
|
||||||
priv->serdev.recv.head, priv->serdev.recv.tail, priv->nrdq, reqlen);
|
priv->serdev.recv.head, priv->serdev.recv.tail, priv->nrdq, reqlen);
|
||||||
|
|
||||||
DEBUGASSERT(priv != NULL && rdcontainer != NULL);
|
|
||||||
#ifdef CONFIG_CDCACM_IFLOWCONTROL
|
#ifdef CONFIG_CDCACM_IFLOWCONTROL
|
||||||
DEBUGASSERT(priv->rxenabled && !priv->iactive);
|
DEBUGASSERT(priv->rxenabled && !priv->iactive);
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user