From f563dab41733c0e73202a8a5977b441715dc9946 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 26 Apr 2017 11:43:39 +0200 Subject: goldfish_pipe: fix build warning about using too much stack. The new goldfish_pipe code used too much stack space in the transfer_max_buffers() call. As the function is serialized with a lock, let's make the buffer static to not use the stack for the large buffer. Reported-by: kbuild test robot Cc: Yurii Zubrytskyi Cc: Jin Qian Signed-off-by: Greg Kroah-Hartman --- drivers/platform/goldfish/goldfish_pipe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/platform/goldfish') diff --git a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c index 9804e9e455d2..2de1e603bd2b 100644 --- a/drivers/platform/goldfish/goldfish_pipe.c +++ b/drivers/platform/goldfish/goldfish_pipe.c @@ -385,7 +385,7 @@ static int transfer_max_buffers(struct goldfish_pipe *pipe, unsigned long last_page, unsigned int last_page_size, s32 *consumed_size, int *status) { - struct page *pages[MAX_BUFFERS_PER_COMMAND]; + static struct page *pages[MAX_BUFFERS_PER_COMMAND]; unsigned long first_page = address & PAGE_MASK; unsigned int iter_last_page_size; int pages_count = pin_user_pages(first_page, last_page, @@ -409,10 +409,10 @@ static int transfer_max_buffers(struct goldfish_pipe *pipe, *consumed_size = pipe->command_buffer->rw_params.consumed_size; - mutex_unlock(&pipe->lock); - release_user_pages(pages, pages_count, is_write, *consumed_size); + mutex_unlock(&pipe->lock); + return 0; } -- cgit v1.2.3