diff options
author | Tom Zanussi <zanussi@kernel.org> | 2019-06-11 08:42:20 -0500 |
---|---|---|
committer | Tom Zanussi <zanussi@kernel.org> | 2019-06-11 08:42:20 -0500 |
commit | d0232ce07eea759cf685caf2917fbc8cc71ff7c1 (patch) | |
tree | 44b98fe3c98cdda708e80396ec69349b8777ff94 /fs/fuse/dev.c | |
parent | 9a1d3ac30fa261dc84546225f5b1683b0cb12464 (diff) | |
parent | 6d1510d86ef67e5fadb8038671e2ec43416daf7f (diff) | |
download | linux-rt-d0232ce07eea759cf685caf2917fbc8cc71ff7c1.tar.gz |
Merge tag 'v4.14.116' into v4.14-rt-work
This is the 4.14.116 stable release
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 63fd33383413..770733106d6d 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1981,10 +1981,8 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, rem += pipe->bufs[(pipe->curbuf + idx) & (pipe->buffers - 1)].len; ret = -EINVAL; - if (rem < len) { - pipe_unlock(pipe); - goto out; - } + if (rem < len) + goto out_free; rem = len; while (rem) { @@ -2002,7 +2000,9 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, pipe->curbuf = (pipe->curbuf + 1) & (pipe->buffers - 1); pipe->nrbufs--; } else { - pipe_buf_get(pipe, ibuf); + if (!pipe_buf_get(pipe, ibuf)) + goto out_free; + *obuf = *ibuf; obuf->flags &= ~PIPE_BUF_FLAG_GIFT; obuf->len = rem; @@ -2025,11 +2025,11 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, ret = fuse_dev_do_write(fud, &cs, len); pipe_lock(pipe); +out_free: for (idx = 0; idx < nbuf; idx++) pipe_buf_release(pipe, &bufs[idx]); pipe_unlock(pipe); -out: kfree(bufs); return ret; } |