Skip to content

Commit f8adaf0

Browse files
emilgoodelinvjw
authored andcommitted
brcmfmac: Fix off by one bug in brcmf_count_20mhz_channels()
In the brcmf_count_20mhz_channels function we are looping through a list of channels received from firmware. Since the index of the first channel is 0 the condition leads to an off by one bug. This is causing us to hit the WARN_ON_ONCE(1) calls in the brcmu_d11n_decchspec function, which is how I discovered the bug. Introduced by: commit b48d891 ("brcmfmac: rework wiphy structure setup") Acked-by: Arend van Spriel <[email protected]> Signed-off-by: Emil Goode <[email protected]> Signed-off-by: John W. Linville <[email protected]>
1 parent 2ba7d14 commit f8adaf0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4921,7 +4921,7 @@ static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg,
49214921
struct brcmu_chan ch;
49224922
int i;
49234923

4924-
for (i = 0; i <= total; i++) {
4924+
for (i = 0; i < total; i++) {
49254925
ch.chspec = (u16)le32_to_cpu(chlist->element[i]);
49264926
cfg->d11inf.decchspec(&ch);
49274927

0 commit comments

Comments
 (0)