diff options
author | Arnd Bergmann <arnd@arndb.de> | 2019-07-22 17:01:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-24 15:46:49 -0700 |
commit | 9eed21c01c7827f029000f77d59b61d1b16cb024 (patch) | |
tree | 51a25a43db74db381b58858e5044a837dcdd6d20 /drivers/net/mii.c | |
parent | 7c116e02a4a7575c8c62bfd2106e3e3ec8fb99dc (diff) | |
download | linux-9eed21c01c7827f029000f77d59b61d1b16cb024.tar.bz2 |
mlx4: avoid large stack usage in mlx4_init_hca()
The mlx4_dev_cap and mlx4_init_hca_param are really too large
to be put on the kernel stack, as shown by this clang warning:
drivers/net/ethernet/mellanox/mlx4/main.c:3304:12: error: stack frame size of 1088 bytes in function 'mlx4_load_one' [-Werror,-Wframe-larger-than=]
With gcc, the problem is the same, but it does not warn because
it does not inline this function, and therefore stays just below
the warning limit, while clang is just above it.
Use kzalloc for dynamic allocation instead of putting them
on stack. This gets the combined stack frame down to 424 bytes.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/mii.c')
0 files changed, 0 insertions, 0 deletions