diff options
| author | Jakub Kicinski <[email protected]> | 2022-05-20 19:43:18 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2022-05-23 00:23:06 +0000 |
| commit | 84f23fb192ef62cef438fdae932ce9d96d131b0c (patch) | |
| tree | f21ba82c7fca8c65a3183518e646aab069a72f50 | |
| parent | wifi: iwlwifi: use unsigned to silence a GCC 12 warning (diff) | |
| download | kernel-84f23fb192ef62cef438fdae932ce9d96d131b0c.tar.gz kernel-84f23fb192ef62cef438fdae932ce9d96d131b0c.zip | |
wifi: brcmfmac: work around a GCC 12 -Warray-bounds warning
GCC 12 really doesn't like partial struct allocations:
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:2202:32: warning: array subscript ‘struct brcmf_ext_join_params_le[0]’ is partly outside array bounds of ‘void[70]’ [-Warray-bounds]
2202 | ext_join_params->scan_le.passive_time =
| ^~
brcmfmac is trying to save 2 bytes at the end by either allocating
or not allocating a channel member. Let's keep @join_params_size
the "right" size but kmalloc() the full structure.
Acked-by: Kalle Valo <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
| -rw-r--r-- | drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c index 360b103fe898..605206abe424 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c @@ -2167,7 +2167,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *ndev, offsetof(struct brcmf_assoc_params_le, chanspec_list); if (cfg->channel) join_params_size += sizeof(u16); - ext_join_params = kzalloc(join_params_size, GFP_KERNEL); + ext_join_params = kzalloc(sizeof(*ext_join_params), GFP_KERNEL); if (ext_join_params == NULL) { err = -ENOMEM; goto done; |
