提交 32c336a5 编写于 作者: A Arend van Spriel 提交者: John W. Linville

brcmsmac: fix brcms_c_regd_init() which crashed after 11ad patch

This patch fixes an OOPS in brcmsmac driver, which was introduced
by the 11ad patch 'cfg80211: add 802.11ad (60gHz band) support'.
The value IEEE80211_NUM_BANDS increased, which was used in the
brcms_c_regd_init() function.

Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Cc: Johannes Berg <johannes.berg@intel.com>
Acked-by: NSeth Forshee <seth.forshee@canonical.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 2b943a33
...@@ -763,20 +763,17 @@ void brcms_c_regd_init(struct brcms_c_info *wlc) ...@@ -763,20 +763,17 @@ void brcms_c_regd_init(struct brcms_c_info *wlc)
int band_idx, i; int band_idx, i;
/* Disable any channels not supported by the phy */ /* Disable any channels not supported by the phy */
for (band_idx = 0; band_idx < IEEE80211_NUM_BANDS; band_idx++) { for (band_idx = 0; band_idx < wlc->pub->_nbands; band_idx++) {
if (band_idx == IEEE80211_BAND_2GHZ) band = wlc->bandstate[band_idx];
band = wlc->bandstate[BAND_2G_INDEX];
else
band = wlc->bandstate[BAND_5G_INDEX];
/* skip if band not initialized */
if (band->pi == NULL)
continue;
wlc_phy_chanspec_band_validch(band->pi, band->bandtype, wlc_phy_chanspec_band_validch(band->pi, band->bandtype,
&sup_chan); &sup_chan);
sband = wiphy->bands[band_idx]; if (band_idx == BAND_2G_INDEX)
sband = wiphy->bands[IEEE80211_BAND_2GHZ];
else
sband = wiphy->bands[IEEE80211_BAND_5GHZ];
for (i = 0; i < sband->n_channels; i++) { for (i = 0; i < sband->n_channels; i++) {
ch = &sband->channels[i]; ch = &sband->channels[i];
if (!isset(sup_chan.vec, ch->hw_value)) if (!isset(sup_chan.vec, ch->hw_value))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册