Skip to content

Commit

Permalink
brcmsmac: fix NULL pointer crash in brcms_c_regd_init()
Browse files Browse the repository at this point in the history
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:
cf03c5d brcm80211: smac: inform mac80211 of the X2 regulatory domain

Cc: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Arend van Spriel authored and John W. Linville committed Jun 22, 2012
1 parent 8dc0181 commit c49aa4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/net/wireless/brcm80211/brcmsmac/channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit c49aa4a

Please sign in to comment.