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

brcmsmac: fix NULL pointer crash in brcms_c_regd_init()

In the function brcms_c_regd_init() the channels are validated
against the device capabilities. This is done for both 2.4G and
5G band, but there are devices that are 2.4G only, ie. BCM4313.
For that device this leads to a NULL dereference. This patch adds
a check in brcms_c_regd_init() to fix this.

Issue introduced in wireless-next tree by following commit:
cf03c5da brcm80211: smac: inform mac80211 of the X2 regulatory domain

Cc: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: NArend van Spriel <arend@broadcom.com>
Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
上级 8dc01811
......@@ -768,6 +768,11 @@ void brcms_c_regd_init(struct brcms_c_info *wlc)
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,
&sup_chan);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册