mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Call nxsem_destroy or nxmutex_destry in the error path
1.Don't check the return value of nxsem_init or nxmutex_init 2.Fix some style issue Signed-off-by: anjiahao <anjiahao@xiaomi.com> Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Petro Karashchenko
parent
99cfffc96a
commit
d7b4e91dda
@@ -716,7 +716,7 @@ static int ads7843e_interrupt(int irq, FAR void *context, FAR void *arg)
|
||||
static int ads7843e_open(FAR struct file *filep)
|
||||
{
|
||||
#ifdef CONFIG_ADS7843E_REFCNT
|
||||
FAR struct inode *inode;
|
||||
FAR struct inode *inode;
|
||||
FAR struct ads7843e_dev_s *priv;
|
||||
uint8_t tmp;
|
||||
int ret;
|
||||
@@ -772,7 +772,7 @@ errout_with_lock:
|
||||
static int ads7843e_close(FAR struct file *filep)
|
||||
{
|
||||
#ifdef CONFIG_ADS7843E_REFCNT
|
||||
FAR struct inode *inode;
|
||||
FAR struct inode *inode;
|
||||
FAR struct ads7843e_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
@@ -943,7 +943,7 @@ errout:
|
||||
|
||||
static int ads7843e_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
FAR struct inode *inode;
|
||||
FAR struct inode *inode;
|
||||
FAR struct ads7843e_dev_s *priv;
|
||||
int ret;
|
||||
|
||||
@@ -1214,6 +1214,7 @@ int ads7843e_register(FAR struct spi_dev_s *spi,
|
||||
|
||||
errout_with_priv:
|
||||
nxmutex_destroy(&priv->devlock);
|
||||
nxsem_destroy(&priv->waitsem);
|
||||
#ifdef CONFIG_ADS7843E_MULTIPLE
|
||||
kmm_free(priv);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user