9
0
Fork 0

Fixes some issues found by the PX4 team using Coverity. From Pavel Krienko

This commit is contained in:
Gregory Nutt 2015-01-19 12:57:25 -06:00
parent 187cd324f6
commit bcfcb485b9
3 changed files with 12 additions and 7 deletions

View File

@ -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:

View File

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

View File

@ -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;
}