summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-11-14 19:48:16 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2014-11-14 19:48:16 +0100
commit3865efcb14f46a5e01852d30a34b2c0dce076b3e (patch)
tree7d090328fecc52bb58bafe979e779649f65e0ea4 /mm
parentMerge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost (diff)
parentFix thinko in iov_iter_single_seg_count (diff)
downloadlinux-3865efcb14f46a5e01852d30a34b2c0dce076b3e.tar.xz
linux-3865efcb14f46a5e01852d30a34b2c0dce076b3e.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs fix from Al Viro: "Fix for a really embarrassing braino in iov_iter. Kudos to paulus..." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: Fix thinko in iov_iter_single_seg_count
Diffstat (limited to 'mm')
-rw-r--r--mm/iov_iter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/iov_iter.c b/mm/iov_iter.c
index eafcf60f6b83..e34a3cb6aad6 100644
--- a/mm/iov_iter.c
+++ b/mm/iov_iter.c
@@ -911,9 +911,9 @@ size_t iov_iter_single_seg_count(const struct iov_iter *i)
if (i->nr_segs == 1)
return i->count;
else if (i->type & ITER_BVEC)
- return min(i->count, i->iov->iov_len - i->iov_offset);
- else
return min(i->count, i->bvec->bv_len - i->iov_offset);
+ else
+ return min(i->count, i->iov->iov_len - i->iov_offset);
}
EXPORT_SYMBOL(iov_iter_single_seg_count);