aboutsummaryrefslogtreecommitdiff
path: root/net/mac80211/sta_info.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2018-03-26 02:32:53 +0000
committerAlex Shi <alex.shi@linaro.org>2018-03-26 02:32:53 +0000
commit38b587878eee8f9f2664135ab76805d0510bb997 (patch)
tree66f5c8eb8821dc7fa1fe91741b24ff7291ef3bf1 /net/mac80211/sta_info.c
parent323174b55ef1de0c70ed0b268fcaf9f2d6f842c6 (diff)
parent24f70aa804cd7f8fee4353cf4990997d1c8375ae (diff)
Merge tag 'v4.9.90' into linux-linaro-lsk-v4.9lsk-v4.9-18.03
This is the 4.9.90 stable release
Diffstat (limited to 'net/mac80211/sta_info.c')
-rw-r--r--net/mac80211/sta_info.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 348700b424ea..1ecf3d07d1f5 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -395,10 +395,15 @@ struct sta_info *sta_info_alloc(struct ieee80211_sub_if_data *sdata,
sta->sta.smps_mode = IEEE80211_SMPS_OFF;
if (sdata->vif.type == NL80211_IFTYPE_AP ||
sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
- struct ieee80211_supported_band *sband =
- hw->wiphy->bands[ieee80211_get_sdata_band(sdata)];
- u8 smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >>
- IEEE80211_HT_CAP_SM_PS_SHIFT;
+ struct ieee80211_supported_band *sband;
+ u8 smps;
+
+ sband = ieee80211_get_sband(sdata);
+ if (!sband)
+ goto free_txq;
+
+ smps = (sband->ht_cap.cap & IEEE80211_HT_CAP_SM_PS) >>
+ IEEE80211_HT_CAP_SM_PS_SHIFT;
/*
* Assume that hostapd advertises our caps in the beacon and
* this is the known_smps_mode for a station that just assciated