From 5952bc7392c7ff3c0d881bc06b2822c5809d2d9e Mon Sep 17 00:00:00 2001 From: anjiahao Date: Mon, 8 Apr 2024 10:00:29 +0800 Subject: [PATCH] fs_dup2:fix inode->i_crefs counting error file_ioctl failed, but close success, inode need release Signed-off-by: anjiahao --- fs/vfs/fs_dup2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/vfs/fs_dup2.c b/fs/vfs/fs_dup2.c index e9e4114e2e..154331afc7 100644 --- a/fs/vfs/fs_dup2.c +++ b/fs/vfs/fs_dup2.c @@ -150,7 +150,7 @@ int file_dup3(FAR struct file *filep1, FAR struct file *filep2, int flags) ret = file_ioctl(filep2, FIONBIO, 0); if (ret < 0 && inode->u.i_ops->close) { - ret = inode->u.i_ops->close(filep2); + inode->u.i_ops->close(filep2); } } }