diff options
author | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-17 14:26:25 -0400 |
commit | 6b0a7f84ea1fe248df96ccc4dd86e817e32ef65b (patch) | |
tree | 0a7976054052e793da782c2b7ec34eccfbf66449 /fs/fuse/dev.c | |
parent | cea0aa9cbd5ad4efe267e9487ed5d48d16756253 (diff) | |
parent | fe5cdef29e41c8bda8cd1a11545e7c6bfe25570e (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflict resolution of af_smc.c from Stephen Rothwell.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/fuse/dev.c')
-rw-r--r-- | fs/fuse/dev.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 8a63e52785e9..9971a35cf1ef 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c | |||
@@ -2056,10 +2056,8 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, | |||
2056 | rem += pipe->bufs[(pipe->curbuf + idx) & (pipe->buffers - 1)].len; | 2056 | rem += pipe->bufs[(pipe->curbuf + idx) & (pipe->buffers - 1)].len; |
2057 | 2057 | ||
2058 | ret = -EINVAL; | 2058 | ret = -EINVAL; |
2059 | if (rem < len) { | 2059 | if (rem < len) |
2060 | pipe_unlock(pipe); | 2060 | goto out_free; |
2061 | goto out; | ||
2062 | } | ||
2063 | 2061 | ||
2064 | rem = len; | 2062 | rem = len; |
2065 | while (rem) { | 2063 | while (rem) { |
@@ -2077,7 +2075,9 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, | |||
2077 | pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1); | 2075 | pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1); |
2078 | pipe->nrbufs--; | 2076 | pipe->nrbufs--; |
2079 | } else { | 2077 | } else { |
2080 | pipe_buf_get(pipe, ibuf); | 2078 | if (!pipe_buf_get(pipe, ibuf)) |
2079 | goto out_free; | ||
2080 | |||
2081 | *obuf = *ibuf; | 2081 | *obuf = *ibuf; |
2082 | obuf->flags &= ~PIPE_BUF_FLAG_GIFT; | 2082 | obuf->flags &= ~PIPE_BUF_FLAG_GIFT; |
2083 | obuf->len = rem; | 2083 | obuf->len = rem; |
@@ -2100,11 +2100,11 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, | |||
2100 | ret = fuse_dev_do_write(fud, &cs, len); | 2100 | ret = fuse_dev_do_write(fud, &cs, len); |
2101 | 2101 | ||
2102 | pipe_lock(pipe); | 2102 | pipe_lock(pipe); |
2103 | out_free: | ||
2103 | for (idx = 0; idx < nbuf; idx++) | 2104 | for (idx = 0; idx < nbuf; idx++) |
2104 | pipe_buf_release(pipe, &bufs[idx]); | 2105 | pipe_buf_release(pipe, &bufs[idx]); |
2105 | pipe_unlock(pipe); | 2106 | pipe_unlock(pipe); |
2106 | 2107 | ||
2107 | out: | ||
2108 | kvfree(bufs); | 2108 | kvfree(bufs); |
2109 | return ret; | 2109 | return ret; |
2110 | } | 2110 | } |