fs_procfs:Fix closedir should handle the release dir handle on a case-by-case basis
Signed-off-by: chenrun1 <chenrun1@xiaomi.com>
This commit is contained in:
parent
b88aba5ddc
commit
b973bf3191
1 changed files with 17 additions and 2 deletions
|
|
@ -787,9 +787,24 @@ static int procfs_opendir(FAR struct inode *mountpt, FAR const char *relpath,
|
|||
static int procfs_closedir(FAR struct inode *mountpt,
|
||||
FAR struct fs_dirent_s *dir)
|
||||
{
|
||||
FAR struct procfs_dir_priv_s *dirpriv;
|
||||
int ret = OK;
|
||||
|
||||
DEBUGASSERT(mountpt && dir);
|
||||
fs_heap_free(dir);
|
||||
return OK;
|
||||
|
||||
dirpriv = (FAR struct procfs_dir_priv_s *)dir;
|
||||
|
||||
if (dirpriv->procfsentry != NULL &&
|
||||
dirpriv->procfsentry->ops->closedir != NULL)
|
||||
{
|
||||
ret = dirpriv->procfsentry->ops->closedir(dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
fs_heap_free(dir);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue