aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-26 05:43:39 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-26 05:43:39 -0400
commitf563dab41733c0e73202a8a5977b441715dc9946 (patch)
treea978195ff9d0302f623990bbb7f2e677b0cfeeb7
parent726ea1a8ea96b2bba34ee2073b58f0770800701c (diff)
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 <fengguang.wu@intel.com> Cc: Yurii Zubrytskyi <zyy@google.com> Cc: Jin Qian <jinqian@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/platform/goldfish/goldfish_pipe.c6
1 files changed, 3 insertions, 3 deletions
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,
385 unsigned long last_page, unsigned int last_page_size, 385 unsigned long last_page, unsigned int last_page_size,
386 s32 *consumed_size, int *status) 386 s32 *consumed_size, int *status)
387{ 387{
388 struct page *pages[MAX_BUFFERS_PER_COMMAND]; 388 static struct page *pages[MAX_BUFFERS_PER_COMMAND];
389 unsigned long first_page = address & PAGE_MASK; 389 unsigned long first_page = address & PAGE_MASK;
390 unsigned int iter_last_page_size; 390 unsigned int iter_last_page_size;
391 int pages_count = pin_user_pages(first_page, last_page, 391 int pages_count = pin_user_pages(first_page, last_page,
@@ -409,10 +409,10 @@ static int transfer_max_buffers(struct goldfish_pipe *pipe,
409 409
410 *consumed_size = pipe->command_buffer->rw_params.consumed_size; 410 *consumed_size = pipe->command_buffer->rw_params.consumed_size;
411 411
412 mutex_unlock(&pipe->lock);
413
414 release_user_pages(pages, pages_count, is_write, *consumed_size); 412 release_user_pages(pages, pages_count, is_write, *consumed_size);
415 413
414 mutex_unlock(&pipe->lock);
415
416 return 0; 416 return 0;
417} 417}
418 418