From: Kari Argillander kari.argillander@gmail.com
mainline inclusion from mainline-v5.15 commit dd854e4b5b12016d27bfa2694226a1c15acbd640 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4G67J?from=project-issue CVE: NA
----------------------------------------------------------------------
This check will be also performed in generic_file_read_iter() so we do not want to check this two times in a row.
This was founded with Smatch fs/ntfs3/file.c:803 ntfs_file_read_iter() warn: unused return: count = iov_iter_count()
Signed-off-by: Kari Argillander kari.argillander@gmail.com Signed-off-by: Konstantin Komarov almaz.alexandrovich@paragon-software.com Signed-off-by: Yin Xiujiang yinxiujiang@kylinos.cn Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com Acked-by: Hou Tao houtao1@huawei.com Acked-by: Xie XiuQi xiexiuqi@huawei.com Signed-off-by: Zheng Zengkai zhengzengkai@huawei.com --- fs/ntfs3/file.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index f9c9a8c91b46..424450e77ad5 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -793,8 +793,6 @@ int ntfs3_setattr(struct user_namespace *mnt_userns, struct dentry *dentry,
static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) { - ssize_t err; - size_t count = iov_iter_count(iter); struct file *file = iocb->ki_filp; struct inode *inode = file->f_mapping->host; struct ntfs_inode *ni = ntfs_i(inode); @@ -823,9 +821,7 @@ static ssize_t ntfs_file_read_iter(struct kiocb *iocb, struct iov_iter *iter) return -EOPNOTSUPP; }
- err = count ? generic_file_read_iter(iocb, iter) : 0; - - return err; + return generic_file_read_iter(iocb, iter); }
/*