drivers/usbdev/cdcacm.c: Avoid using priv before checking its validity.

This commit is contained in:
Juha Niskanen 2017-09-26 06:31:30 -06:00 committed by Gregory Nutt
parent b5123603fd
commit d141242a25
1 changed files with 2 additions and 2 deletions

View File

@ -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 */