diff options
author | Xianzhong <xianzhong.li@nxp.com> | 2017-07-13 10:28:14 +0800 |
---|---|---|
committer | Bryan O'Donoghue <bryan.odonoghue@linaro.org> | 2019-05-01 17:43:26 +0100 |
commit | b531e44e19d78abe98b14653bfdb1b2e205f1625 (patch) | |
tree | 3ce7e6e9a1a95440f57c792f21611393514ef3da | |
parent | 4827115c1eda06df4be950b2078490a743945f27 (diff) |
MGS-3083 [#imx-662] fix kernel build error with kasan config
hal/kernel/gc_hal_kernel_command.c: In function gckCOMMAND_Commit:
hal/kernel/gc_hal_kernel_command.c:2718:1:
error: the frame size of 2288 bytes is larger than 2048 bytes [-Werror=frame-larger-than=]
removed _commandBufferObject instrance, use kmalloc to avoid kasan error.
Date: Jul 13, 2017
Signed-off-by: Xianzhong <xianzhong.li@nxp.com>
(cherry picked from commit d8d57e43a24bd02b375d7c6bd633ed236db19337)
(cherry picked from commit 484e3073adf47d27581482f268b01fe5fe219d18)
-rw-r--r-- | drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c index 528860cf4b45..2db8e4d961a2 100644 --- a/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c +++ b/drivers/mxc/gpu-viv/hal/kernel/gc_hal_kernel_command.c @@ -1790,7 +1790,6 @@ gckCOMMAND_Commit( #if !gcdNULL_DRIVER gcsCONTEXT_PTR contextBuffer; - struct _gcoCMDBUF _commandBufferObject; gctPHYS_ADDR_T commandBufferPhysical; gctUINT8_PTR commandBufferLogical = gcvNULL; gctUINT32 commandBufferAddress = 0; @@ -1904,7 +1903,8 @@ gckCOMMAND_Commit( #else if (needCopy) { - commandBufferObject = &_commandBufferObject; + gcmkONERROR(gckOS_Allocate(Command->os, gcmSIZEOF(struct _gcoCMDBUF), &pointer)); + commandBufferObject = pointer; gcmkONERROR(gckOS_CopyFromUserData( Command->os, @@ -2587,6 +2587,10 @@ gckCOMMAND_Commit( commandBufferMapped = gcvFALSE; } + else if (needCopy) + { + gcmkONERROR(gckOS_Free(Command->os, commandBufferObject)); + } /* Return status. */ gcmkFOOTER(); @@ -2626,6 +2630,10 @@ OnError: commandBufferObject )); } + else if (needCopy) + { + gcmkVERIFY_OK(gckOS_Free(Command->os, commandBufferObject)); + } /* Return status. */ gcmkFOOTER(); |