]> git.baikalelectronics.ru Git - kernel.git/commit
staging: vchiq_arm: Clear VLA warning
authorStefan Wahren <stefan.wahren@i2se.com>
Sat, 28 Apr 2018 15:47:42 +0000 (17:47 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2018 02:04:43 +0000 (19:04 -0700)
commit20bf3c08c17895186d3e66c7da96bbe6d3a24707
treefc2edcc7b5e2b3e79c9ad3eeef56516b20288a5d
parent940c899241634e53b5a937b4ed4b0637c09a2530
staging: vchiq_arm: Clear VLA warning

The kernel would like to have all stack VLA usage removed[1]. The array
here is fixed (declared with a const variable) but it appears like a VLA
to the compiler. Also, currently we are putting 768 bytes on the
stack. This function is only called on the error path so performance is
not critical, let's just allocate the memory instead of using the
stack. This saves stack space and removes the VLA build warning.

kmalloc a buffer for dumping state instead of using the stack.

[1]: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Tobin C. Harding <me@tobin.cc>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c