]> asedeno.scripts.mit.edu Git - linux.git/commit
mtd: sa1100: avoid VLA in sa1100_setup_mtd
authorBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 5 Nov 2018 07:58:35 +0000 (08:58 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 6 Nov 2018 09:38:17 +0000 (10:38 +0100)
commitba26cd7d58dcc50e25c8f02b5376c05046b181dc
tree4331ccc5c4a6ad053376871404fd7d7e527e4f56
parent90c31cb9a8115a1183daed9a714eea4be0687931
mtd: sa1100: avoid VLA in sa1100_setup_mtd

Enabling -Wvla found another variable-length array with randconfig
testing:

drivers/mtd/maps/sa1100-flash.c: In function 'sa1100_setup_mtd':
drivers/mtd/maps/sa1100-flash.c:224:10: error: ISO C90 forbids variable length array 'cdev' [-Werror=vla]

Dynamically allocate the cdev array passed to mtd_concat_create()
instead of using a VLA.

Reported-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Olof Johansson <olof@lixom.net>
drivers/mtd/maps/sa1100-flash.c