diff options
author | Kees Cook <[email protected]> | 2024-01-26 14:31:53 -0800 |
---|---|---|
committer | Kalle Valo <[email protected]> | 2024-02-02 18:40:28 +0200 |
commit | 5bdda0048c8d1bbe2019513b2d6200cc0d09c7bd (patch) | |
tree | 4cf0ce84315028394fbfcfd6483d1c7097c46c39 /scripts/generate_rust_analyzer.py | |
parent | a23c0af103e184bb1252dddddda040f6641bea7b (diff) |
wifi: brcmfmac: Adjust n_channels usage for __counted_by
After commit e3eac9f32ec0 ("wifi: cfg80211: Annotate struct
cfg80211_scan_request with __counted_by"), the compiler may enforce
dynamic array indexing of req->channels to stay below n_channels. As a
result, n_channels needs to be increased _before_ accessing the newly
added array index. Increment it first, then use "i" for the prior index.
Solves this warning in the coming GCC that has __counted_by support:
../drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c: In function 'brcmf_internal_escan_add_info':
../drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c:3783:46: warning: operation on 'req->
n_channels' may be undefined [-Wsequence-point]
3783 | req->channels[req->n_channels++] = chan;
| ~~~~~~~~~~~~~~~^~
Fixes: e3eac9f32ec0 ("wifi: cfg80211: Annotate struct cfg80211_scan_request with __counted_by")
Cc: Arend van Spriel <[email protected]>
Cc: Franky Lin <[email protected]>
Cc: Hante Meuleman <[email protected]>
Cc: Kalle Valo <[email protected]>
Cc: Chi-hsien Lin <[email protected]>
Cc: Ian Lin <[email protected]>
Cc: Johannes Berg <[email protected]>
Cc: Wright Feng <[email protected]>
Cc: Hector Martin <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://msgid.link/[email protected]
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions