mirror of
https://github.com/apache/nuttx.git
synced 2026-05-28 03:45:50 +08:00
drivers/usbdev/cdcacm.c: Avoid using priv before checking its validity.
This commit is contained in:
committed by
Gregory Nutt
parent
b5123603fd
commit
d141242a25
@@ -640,8 +640,6 @@ static int cdcacm_serialstate(FAR struct cdcacm_dev_s *priv)
|
|||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
usbtrace(CDCACM_CLASSAPI_FLOWCONTROL, (uint16_t)priv->serialstate);
|
|
||||||
|
|
||||||
DEBUGASSERT(priv != NULL && priv->epintin != NULL);
|
DEBUGASSERT(priv != NULL && priv->epintin != NULL);
|
||||||
#ifdef CONFIG_DEBUG_FEATURES
|
#ifdef CONFIG_DEBUG_FEATURES
|
||||||
if (priv == NULL || priv->epintin == NULL)
|
if (priv == NULL || priv->epintin == NULL)
|
||||||
@@ -651,6 +649,8 @@ static int cdcacm_serialstate(FAR struct cdcacm_dev_s *priv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
usbtrace(CDCACM_CLASSAPI_FLOWCONTROL, (uint16_t)priv->serialstate);
|
||||||
|
|
||||||
flags = enter_critical_section();
|
flags = enter_critical_section();
|
||||||
|
|
||||||
/* Use our interrupt IN endpoint for the transfer */
|
/* Use our interrupt IN endpoint for the transfer */
|
||||||
|
|||||||
Reference in New Issue
Block a user