fs_dup2:fix inode->i_crefs counting error

file_ioctl failed, but close success, inode need release

Signed-off-by: anjiahao <anjiahao@xiaomi.com>
This commit is contained in:
anjiahao 2024-04-08 10:00:29 +08:00 committed by Xiang Xiao
parent 3fb6b4c9ec
commit 5952bc7392

View File

@ -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);
}
}
}