mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +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;
|
||||
int ret;
|
||||
|
||||
usbtrace(CDCACM_CLASSAPI_FLOWCONTROL, (uint16_t)priv->serialstate);
|
||||
|
||||
DEBUGASSERT(priv != NULL && priv->epintin != NULL);
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
if (priv == NULL || priv->epintin == NULL)
|
||||
@@ -651,6 +649,8 @@ static int cdcacm_serialstate(FAR struct cdcacm_dev_s *priv)
|
||||
}
|
||||
#endif
|
||||
|
||||
usbtrace(CDCACM_CLASSAPI_FLOWCONTROL, (uint16_t)priv->serialstate);
|
||||
|
||||
flags = enter_critical_section();
|
||||
|
||||
/* Use our interrupt IN endpoint for the transfer */
|
||||
|
||||
Reference in New Issue
Block a user