vfs/fs_pseudofile: fix coverity issue
Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
0f6d0eac52
commit
8336ee78b8
@ -424,20 +424,29 @@ int pseudofile_create(FAR struct inode **node, FAR const char *path,
|
||||
ret = inode_lock();
|
||||
if (ret < 0)
|
||||
{
|
||||
nxmutex_destroy(&pf->lock);
|
||||
kmm_free(pf);
|
||||
return ret;
|
||||
goto lock_err;
|
||||
}
|
||||
|
||||
ret = inode_reserve(path, mode, node);
|
||||
if (ret < 0)
|
||||
{
|
||||
goto reserve_err;
|
||||
}
|
||||
|
||||
inode_reserve(path, mode, node);
|
||||
(*node)->i_crefs = 0;
|
||||
(*node)->i_flags = 1;
|
||||
(*node)->u.i_ops = &g_pseudofile_ops;
|
||||
(*node)->i_private = pf;
|
||||
|
||||
inode_unlock();
|
||||
|
||||
return 0;
|
||||
|
||||
reserve_err:
|
||||
inode_unlock();
|
||||
lock_err:
|
||||
nxmutex_destroy(&pf->lock);
|
||||
kmm_free(pf);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
Loading…
x
Reference in New Issue
Block a user