linux-stable/drivers/gpu
Gustavo A. R. Silva 0126b23c55 drm/vc4_validate: Remove VLA usage
In preparation to enabling -Wvla, remove VLA. In this particular
case use macro ARRAY_SIZE so the length of array _bo_ can be
computed at preprocessing time.

The use of stack Variable Length Arrays needs to be avoided, as they
can be a vector for stack exhaustion, which can be both a runtime bug
or a security flaw. Also, in general, as code evolves it is easy to
lose track of how big a VLA can get. Thus, we can end up having runtime
failures that are hard to debug.

Also, fixed as part of the directive to remove all VLAs from
the kernel: https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20180313143151.GA27486@embeddedgus
2018-03-16 15:51:52 -07:00
..
drm drm/vc4_validate: Remove VLA usage 2018-03-16 15:51:52 -07:00
host1x gpu: host1x: Use IOMMU groups 2017-12-21 14:52:36 +01:00
ipu-v3 gpu: ipu-v3: allow to build with COMPILE_TEST 2017-12-19 12:49:11 +01:00
vga vga_switcheroo: Let HDA autosuspend on mux change 2018-03-13 22:58:49 +01:00
Makefile