rtc: s5m: Remove VLA usage
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Sat, 10 Mar 2018 06:27:35 +0000 (00:27 -0600)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Sat, 17 Mar 2018 13:20:57 +0000 (14:20 +0100)
commit756d5282bf04db868b1c0b93f41981dabe2af57f
tree4631fc3f2adbe463c97c2ea3d3fd3b7dfaa45579
parent4a681243cc2d2cea98c6b5e57224f3bcb08bce6c
rtc: s5m: Remove VLA usage

In preparation to enabling -Wvla, remove VLAs and replace them
with fixed-length arrays instead.

>From a security viewpoint, the use of Variable Length Arrays can be
a vector for stack overflow attacks. Also, in general, as the code
evolves it is easy to lose track of how big a VLA can get. Thus, we
can end up having segfaults 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>
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-s5m.c