aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/mvm
diff options
context:
space:
mode:
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-12-20 07:48:08 -0500
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>2015-12-20 07:48:08 -0500
commit12f17211f75531139ea4394f7f7b4f2090f9778a (patch)
tree31d2614a4c2cfc72a321283ee245f70a2a4bf2b5 /drivers/net/wireless/intel/iwlwifi/mvm
parente70d41b59f30d2f26f505890d9a893e924b359bf (diff)
parent4585436091cd812b1165aab71bd4847ea1cb08ec (diff)
Merge tag 'iwlwifi-for-kalle-2015-12-16' into next
* don't load firmware that won't exist for 7260 * fix RCU splat
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/mvm/sta.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 78ff21a88a8b..df1fed7e4c1c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -1224,8 +1224,8 @@ static u8 iwl_mvm_get_key_sta_id(struct iwl_mvm *mvm,
1224 mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) { 1224 mvmvif->ap_sta_id != IWL_MVM_STATION_COUNT) {
1225 u8 sta_id = mvmvif->ap_sta_id; 1225 u8 sta_id = mvmvif->ap_sta_id;
1226 1226
1227 sta = rcu_dereference_protected(mvm->fw_id_to_mac_id[sta_id], 1227 sta = rcu_dereference_check(mvm->fw_id_to_mac_id[sta_id],
1228 lockdep_is_held(&mvm->mutex)); 1228 lockdep_is_held(&mvm->mutex));
1229 /* 1229 /*
1230 * It is possible that the 'sta' parameter is NULL, 1230 * It is possible that the 'sta' parameter is NULL,
1231 * for example when a GTK is removed - the sta_id will then 1231 * for example when a GTK is removed - the sta_id will then
@@ -1592,14 +1592,15 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
1592 u16 *phase1key) 1592 u16 *phase1key)
1593{ 1593{
1594 struct iwl_mvm_sta *mvm_sta; 1594 struct iwl_mvm_sta *mvm_sta;
1595 u8 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta); 1595 u8 sta_id;
1596 bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE); 1596 bool mcast = !(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE);
1597 1597
1598 if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT))
1599 return;
1600
1601 rcu_read_lock(); 1598 rcu_read_lock();
1602 1599
1600 sta_id = iwl_mvm_get_key_sta_id(mvm, vif, sta);
1601 if (WARN_ON_ONCE(sta_id == IWL_MVM_STATION_COUNT))
1602 goto unlock;
1603
1603 if (!sta) { 1604 if (!sta) {
1604 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]); 1605 sta = rcu_dereference(mvm->fw_id_to_mac_id[sta_id]);
1605 if (WARN_ON(IS_ERR_OR_NULL(sta))) { 1606 if (WARN_ON(IS_ERR_OR_NULL(sta))) {
@@ -1611,6 +1612,8 @@ void iwl_mvm_update_tkip_key(struct iwl_mvm *mvm,
1611 mvm_sta = iwl_mvm_sta_from_mac80211(sta); 1612 mvm_sta = iwl_mvm_sta_from_mac80211(sta);
1612 iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast, 1613 iwl_mvm_send_sta_key(mvm, mvm_sta, keyconf, mcast,
1613 iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx); 1614 iv32, phase1key, CMD_ASYNC, keyconf->hw_key_idx);
1615
1616 unlock:
1614 rcu_read_unlock(); 1617 rcu_read_unlock();
1615} 1618}
1616 1619