forked from nuttx/nuttx-update
Fixes some issues found by the PX4 team using Coverity. From Pavel Krienko
This commit is contained in:
parent
54847c118f
commit
a4a6917267
3 changed files with 12 additions and 7 deletions
|
@ -275,7 +275,10 @@ errout_with_wrfd:
|
|||
errout_with_driver:
|
||||
unregister_driver(devname);
|
||||
errout_with_dev:
|
||||
pipecommon_freedev(dev);
|
||||
if (dev)
|
||||
{
|
||||
pipecommon_freedev(dev);
|
||||
}
|
||||
errout_with_pipe:
|
||||
pipe_free(pipeno);
|
||||
errout:
|
||||
|
|
|
@ -1205,14 +1205,15 @@ static void cdcacm_unbind(FAR struct usbdevclass_driver_s *driver,
|
|||
priv->nwrq--; /* Number of write requests queued */
|
||||
}
|
||||
}
|
||||
|
||||
DEBUGASSERT(priv->nwrq == 0);
|
||||
irqrestore(flags);
|
||||
|
||||
/* Clear out all data in the circular buffer */
|
||||
|
||||
priv->serdev.xmit.head = 0;
|
||||
priv->serdev.xmit.tail = 0;
|
||||
}
|
||||
|
||||
/* Clear out all data in the circular buffer */
|
||||
|
||||
priv->serdev.xmit.head = 0;
|
||||
priv->serdev.xmit.tail = 0;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
@ -245,9 +245,10 @@ static inline FAR void *gran_common_alloc(FAR struct gran_s *priv, size_t size)
|
|||
bitidx += shift;
|
||||
}
|
||||
}
|
||||
|
||||
gran_leave_critical(priv);
|
||||
}
|
||||
|
||||
gran_leave_critical(priv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue