aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/sta_info.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index 3de7a2260d65..730197591ab5 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -855,8 +855,12 @@ struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw,
855 struct sta_info *sta, *nxt; 855 struct sta_info *sta, *nxt;
856 856
857 /* Just return a random station ... first in list ... */ 857 /* Just return a random station ... first in list ... */
858 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) 858 for_each_sta_info(hw_to_local(hw), addr, sta, nxt) {
859 if (!sta->uploaded)
860 return NULL;
859 return &sta->sta; 861 return &sta->sta;
862 }
863
860 return NULL; 864 return NULL;
861} 865}
862EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw); 866EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw);
@@ -864,14 +868,19 @@ EXPORT_SYMBOL_GPL(ieee80211_find_sta_by_hw);
864struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, 868struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif,
865 const u8 *addr) 869 const u8 *addr)
866{ 870{
867 struct ieee80211_sub_if_data *sdata; 871 struct sta_info *sta;
868 872
869 if (!vif) 873 if (!vif)
870 return NULL; 874 return NULL;
871 875
872 sdata = vif_to_sdata(vif); 876 sta = sta_info_get_bss(vif_to_sdata(vif), addr);
877 if (!sta)
878 return NULL;
879
880 if (!sta->uploaded)
881 return NULL;
873 882
874 return ieee80211_find_sta_by_hw(&sdata->local->hw, addr); 883 return &sta->sta;
875} 884}
876EXPORT_SYMBOL(ieee80211_find_sta); 885EXPORT_SYMBOL(ieee80211_find_sta);
877 886