diff options
author | Thomas Pedersen <c_tpeder@qca.qualcomm.com> | 2012-04-24 15:50:41 -0400 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2012-04-25 02:36:00 -0400 |
commit | 03e2084a843a700089a479e0ffdf5876c7059411 (patch) | |
tree | e5b41aa17b6c17712a81d9f85d43d2967fad9b68 /drivers/net | |
parent | 1560ac7d304fdbe603e2fe9cf9564dc81dcccc98 (diff) |
ath6kl: check for sband existence when creating scan cmd
The patch "ath6kl: support fw reporting phy capabilities" gave the
firmware the ability to disable certain wiphy supported bands. Check if
this is the case in ath6kl_wmi_beginscan_cmd to avoid dereferencing a
NULL pointer.
kvalo: change the patch so that there's no code between declarations
Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/ath/ath6kl/wmi.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index bb802e49919c..102477d5900f 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c | |||
@@ -1818,12 +1818,14 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, | |||
1818 | u32 home_dwell_time, u32 force_scan_interval, | 1818 | u32 home_dwell_time, u32 force_scan_interval, |
1819 | s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates) | 1819 | s8 num_chan, u16 *ch_list, u32 no_cck, u32 *rates) |
1820 | { | 1820 | { |
1821 | struct ieee80211_supported_band *sband; | ||
1821 | struct sk_buff *skb; | 1822 | struct sk_buff *skb; |
1822 | struct wmi_begin_scan_cmd *sc; | 1823 | struct wmi_begin_scan_cmd *sc; |
1823 | s8 size; | 1824 | s8 size, *supp_rates; |
1824 | int i, band, ret; | 1825 | int i, band, ret; |
1825 | struct ath6kl *ar = wmi->parent_dev; | 1826 | struct ath6kl *ar = wmi->parent_dev; |
1826 | int num_rates; | 1827 | int num_rates; |
1828 | u32 ratemask; | ||
1827 | 1829 | ||
1828 | size = sizeof(struct wmi_begin_scan_cmd); | 1830 | size = sizeof(struct wmi_begin_scan_cmd); |
1829 | 1831 | ||
@@ -1850,10 +1852,13 @@ int ath6kl_wmi_beginscan_cmd(struct wmi *wmi, u8 if_idx, | |||
1850 | sc->num_ch = num_chan; | 1852 | sc->num_ch = num_chan; |
1851 | 1853 | ||
1852 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { | 1854 | for (band = 0; band < IEEE80211_NUM_BANDS; band++) { |
1853 | struct ieee80211_supported_band *sband = | 1855 | sband = ar->wiphy->bands[band]; |
1854 | ar->wiphy->bands[band]; | 1856 | |
1855 | u32 ratemask = rates[band]; | 1857 | if (!sband) |
1856 | u8 *supp_rates = sc->supp_rates[band].rates; | 1858 | continue; |
1859 | |||
1860 | ratemask = rates[band]; | ||
1861 | supp_rates = sc->supp_rates[band].rates; | ||
1857 | num_rates = 0; | 1862 | num_rates = 0; |
1858 | 1863 | ||
1859 | for (i = 0; i < sband->n_bitrates; i++) { | 1864 | for (i = 0; i < sband->n_bitrates; i++) { |