Skip to content

Commit

Permalink
fuse: reduce allocation size for splice_write
Browse files Browse the repository at this point in the history
The 'bufs' array contains 'pipe->buffers' elements, but the
fuse_dev_splice_write() uses only 'pipe->nrbufs' elements.

So reduce the allocation size to 'pipe->nrbufs' elements.

Signed-off-by: Andrey Ryabinin <[email protected]>
Signed-off-by: Miklos Szeredi <[email protected]>
  • Loading branch information
aryabinin authored and Miklos Szeredi committed Jul 26, 2018
1 parent d6d931a commit 9635453
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe,

pipe_lock(pipe);

bufs = kvmalloc_array(pipe->buffers, sizeof(struct pipe_buffer),
bufs = kvmalloc_array(pipe->nrbufs, sizeof(struct pipe_buffer),
GFP_KERNEL);
if (!bufs) {
pipe_unlock(pipe);
Expand Down

0 comments on commit 9635453

Please sign in to comment.