]> git.baikalelectronics.ru Git - kernel.git/commit
brcmfmac: Fix off by one bug in brcmf_count_20mhz_channels()
authorEmil Goode <emilgoode@gmail.com>
Mon, 22 Sep 2014 22:49:55 +0000 (00:49 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 23 Sep 2014 14:48:26 +0000 (10:48 -0400)
commit2536824a55982fc939da2acf696b87dbbec406da
tree98060a8edc814aff391176d706113a6d83e425ff
parent70d38cef63333ae799620c90cce2af60500f88a7
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 84d45594d098d6bddd5a930ba9a9c66e69f9061f
("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>
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c