]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
wcn36xx: use dynamic allocation for large variables
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Jul 2019 14:59:01 +0000 (16:59 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 4 Sep 2019 06:22:26 +0000 (09:22 +0300)
commit355cf31912014e6ff1bb1019ae4858cad12c68cf
tree727f5e7cbf0fbe1cb1f3fa0dffae091578270284
parent0e7bf23e496770323b08a95633f3247e60b3edca
wcn36xx: use dynamic allocation for large variables

clang triggers a warning about oversized stack frames that gcc does not
notice because of slightly different inlining decisions:

ath/wcn36xx/smd.c:1409:5: error: stack frame size of 1040 bytes in function 'wcn36xx_smd_config_bss' [-Werror,-Wframe-larger-than=]
ath/wcn36xx/smd.c:640:5: error: stack frame size of 1032 bytes in function 'wcn36xx_smd_start_hw_scan' [-Werror,-Wframe-larger-than=]

Basically the wcn36xx_hal_start_scan_offload_req_msg,
wcn36xx_hal_config_bss_req_msg_v1, and wcn36xx_hal_config_bss_req_msg
structures are too large to be put on the kernel stack, but small
enough that gcc does not warn about them.

Use kzalloc() to allocate them all. There are similar structures in other
parts of this driver, but they are all smaller, with the next largest
stack frame at 480 bytes for wcn36xx_smd_send_beacon.

Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/wcn36xx/smd.c