Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28269580 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull vfs fix from Al Viro:
 "Oh, well...  Still nothing useful on that livelock (I had something
  that looked kinda-sorta like a non-invasive solution, but it
  deadlocks), so it's just Miklos' vmsplice fix for now"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  vfs: fix vmplice_to_user()
parents 4efdedca b6dd6f47
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1537,7 +1537,7 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
	struct iovec iovstack[UIO_FASTIOV];
	struct iovec *iov = iovstack;
	struct iov_iter iter;
	ssize_t count = 0;
	ssize_t count;

	pipe = get_pipe_info(file);
	if (!pipe)
@@ -1546,8 +1546,9 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
	ret = rw_copy_check_uvector(READ, uiov, nr_segs,
				    ARRAY_SIZE(iovstack), iovstack, &iov);
	if (ret <= 0)
		return ret;
		goto out;

	count = ret;
	iov_iter_init(&iter, iov, nr_segs, count, 0);

	sd.len = 0;
@@ -1560,6 +1561,7 @@ static long vmsplice_to_user(struct file *file, const struct iovec __user *uiov,
	ret = __splice_from_pipe(pipe, &sd, pipe_to_user);
	pipe_unlock(pipe);

out:
	if (iov != iovstack)
		kfree(iov);