From a5109edd745def0ffe347df9d0a7260ebc39c8f3 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Thu, 12 Mar 2020 19:01:18 +0900 Subject: [PATCH] amlogic: media_modules: fix too big stack usage for gcc 9 build Too big stack usage causes build issue for gcc 9. Fix too big stack usage by replacing kzalloc() instead of array in stack. Signed-off-by: Seung-Woo Kim --- .../media_modules/frame_provider/decoder/utils/frame_check.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/media_modules/frame_provider/decoder/utils/frame_check.c b/drivers/amlogic/media_modules/frame_provider/decoder/utils/frame_check.c index 95d260959b8a..7118bd1d5c9f 100644 --- a/drivers/amlogic/media_modules/frame_provider/decoder/utils/frame_check.c +++ b/drivers/amlogic/media_modules/frame_provider/decoder/utils/frame_check.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -316,11 +317,12 @@ static int write_yuv_work(struct pic_check_mgr_t *mgr) static int write_crc_work(struct pic_check_mgr_t *mgr) { unsigned int wr_size; - char *crc_buf, crc_tmp[64*30]; + char *crc_buf, *crc_tmp; mm_segment_t old_fs; struct pic_check_t *check = &mgr->pic_check; if (mgr->enable & CRC_MASK) { + crc_tmp = kzalloc(64 * 30 * sizeof(char), GFP_KERNEL); wr_size = 0; while (kfifo_get(&check->wr_chk_q, &crc_buf) != 0) { wr_size += sprintf(&crc_tmp[wr_size], "%s", crc_buf); @@ -342,6 +344,7 @@ static int write_crc_work(struct pic_check_mgr_t *mgr) } set_fs(old_fs); } + kfree(crc_tmp); } return 0; } -- 2.34.1