Merge branch 'work.iov_iter' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[muen/linux.git] / lib / iov_iter.c
index ae82d9c..f835964 100644 (file)
@@ -790,6 +790,8 @@ void iov_iter_revert(struct iov_iter *i, size_t unroll)
 {
        if (!unroll)
                return;
 {
        if (!unroll)
                return;
+       if (WARN_ON(unroll > MAX_RW_COUNT))
+               return;
        i->count += unroll;
        if (unlikely(i->type & ITER_PIPE)) {
                struct pipe_inode_info *pipe = i->pipe;
        i->count += unroll;
        if (unlikely(i->type & ITER_PIPE)) {
                struct pipe_inode_info *pipe = i->pipe;