drivers/usbdev/cdcacm.c: Avoid using priv before checking its validity.
This commit is contained in:
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 */
|
||||
|
|
Loading…
Reference in New Issue