aboutsummaryrefslogtreecommitdiffstats
path: root/fs/splice.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-06-12 00:27:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-06-12 00:28:09 -0400
commit9c1d5284c79fea050f115eadeec1dd1758e5c630 (patch)
tree4d16fd5aad7ff4931e985c0128c5747f23561f8a /fs/splice.c
parent5f073850602084fbcbb987948ff3e70ae273f7d2 (diff)
parent9f12600fe425bc28f0ccba034a77783c09c15af4 (diff)
Merge commit '9f12600fe425bc28f0ccba034a77783c09c15af4' into for-linus
Backmerge of dcache.c changes from mainline. It's that, or complete rebase... Conflicts: fs/splice.c Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/splice.c')
-rw-r--r--fs/splice.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/splice.c b/fs/splice.c
index 8e7eef755a9b..f5cb9ba84510 100644
--- a/fs/splice.c
+++ b/fs/splice.c
@@ -1548,7 +1548,7 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
1548 struct iovec iovstack[UIO_FASTIOV]; 1548 struct iovec iovstack[UIO_FASTIOV];
1549 struct iovec *iov = iovstack; 1549 struct iovec *iov = iovstack;
1550 struct iov_iter iter; 1550 struct iov_iter iter;
1551 ssize_t count = 0; 1551 ssize_t count;
1552 1552
1553 pipe = get_pipe_info(file); 1553 pipe = get_pipe_info(file);
1554 if (!pipe) 1554 if (!pipe)
@@ -1557,8 +1557,9 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
1557 ret = rw_copy_check_uvector(READ, uiov, nr_segs, 1557 ret = rw_copy_check_uvector(READ, uiov, nr_segs,
1558 ARRAY_SIZE(iovstack), iovstack, &iov); 1558 ARRAY_SIZE(iovstack), iovstack, &iov);
1559 if (ret <= 0) 1559 if (ret <= 0)
1560 return ret; 1560 goto out;
1561 1561
1562 count = ret;
1562 iov_iter_init(&iter, READ, iov, nr_segs, count); 1563 iov_iter_init(&iter, READ, iov, nr_segs, count);
1563 1564
1564 sd.len = 0; 1565 sd.len = 0;
@@ -1571,6 +1572,7 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
1571 ret = __splice_from_pipe(pipe, &sd, pipe_to_user); 1572 ret = __splice_from_pipe(pipe, &sd, pipe_to_user);
1572 pipe_unlock(pipe); 1573 pipe_unlock(pipe);
1573 1574
1575out:
1574 if (iov != iovstack) 1576 if (iov != iovstack)
1575 kfree(iov); 1577 kfree(iov);
1576 1578