This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new bed1845333 inode:call inode_release when close success
bed1845333 is described below

commit bed1845333d974b6b8af7543dbbb8e485bccdd68
Author: guohao15 <[email protected]>
AuthorDate: Fri Aug 9 16:13:56 2024 +0800

    inode:call inode_release when close success
    
    inode will be double released
    in close(fd) and files_putlist(&group->tg_filelist)
    
    Signed-off-by: guohao15 <[email protected]>
---
 fs/vfs/fs_close.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/fs/vfs/fs_close.c b/fs/vfs/fs_close.c
index 6058a41c04..a5197e49f7 100644
--- a/fs/vfs/fs_close.c
+++ b/fs/vfs/fs_close.c
@@ -81,7 +81,10 @@ int file_close_without_clear(FAR struct file *filep)
 
       /* And release the inode */
 
-      inode_release(inode);
+      if (ret >= 0)
+        {
+          inode_release(inode);
+        }
     }
 
   return ret;

Reply via email to