]> git.baikalelectronics.ru Git - kernel.git/commit
net: stmmac: Avoid VLA usage
authorKees Cook <keescook@chromium.org>
Tue, 1 May 2018 21:01:30 +0000 (14:01 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 May 2018 15:11:30 +0000 (11:11 -0400)
commitda4b3a8e9b10cf0a0e94fb62b182e3f7d25fc7ee
tree2cf6169fe64f112c23cfd632c6c413f1b050aeb6
parent3e6919c6d382965b92bb873ff2609da770586027
net: stmmac: Avoid VLA usage

In the quest to remove all stack VLAs from the kernel[1], this switches
the "status" stack buffer to use the existing small (8) upper bound on
how many queues can be checked for DMA, and adds a sanity-check just to
make sure it doesn't operate under pathological conditions.

[1] http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com

Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jose Abreu <joabreu@synopsys.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c