From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Andrey Ryabinin To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrey Ryabinin Subject: [PATCH 2/2] fs/fuse, splice_write: reduce allocation size. Date: Mon, 16 Jul 2018 19:03:44 +0300 Message-Id: <20180716160344.7015-2-aryabinin@virtuozzo.com> In-Reply-To: <20180716160344.7015-1-aryabinin@virtuozzo.com> References: <20180716160344.7015-1-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: 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 --- fs/fuse/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c index 74900571546d..39789f070cde 100644 --- a/fs/fuse/dev.c +++ b/fs/fuse/dev.c @@ -1944,7 +1944,7 @@ static ssize_t fuse_dev_splice_write(struct pipe_inode_info *pipe, if (!fud) return -EPERM; - bufs = kvmalloc_array(pipe->buffers, sizeof(struct pipe_buffer), + bufs = kvmalloc_array(pipe->nrbufs, sizeof(struct pipe_buffer), GFP_KERNEL); if (!bufs) return -ENOMEM; -- 2.16.4