summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorEmil Goode <emilgoode@gmail.com>2014-09-23 00:49:55 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-09-23 10:48:26 -0400
commitf8adaf0ae978252c9f7e29e96aefcd8fcaf806ba (patch)
tree98060a8edc814aff391176d706113a6d83e425ff /drivers
parent2ba7d144d39a596cf5d09390ee7de21cfb69cf2b (diff)
downloadlinux-f8adaf0ae978252c9f7e29e96aefcd8fcaf806ba.tar.gz
linux-f8adaf0ae978252c9f7e29e96aefcd8fcaf806ba.tar.bz2
linux-f8adaf0ae978252c9f7e29e96aefcd8fcaf806ba.zip
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 b48d891676f756d48b4d0ee131e4a7a5d43ca417 ("brcmfmac: rework wiphy structure setup") Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Emil Goode <emilgoode@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index f3a9804988a6..16a246bfc343 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -4921,7 +4921,7 @@ static void brcmf_count_20mhz_channels(struct brcmf_cfg80211_info *cfg,
struct brcmu_chan ch;
int i;
- for (i = 0; i <= total; i++) {
+ for (i = 0; i < total; i++) {
ch.chspec = (u16)le32_to_cpu(chlist->element[i]);
cfg->d11inf.decchspec(&ch);