diff options
author | Sara Sharon <sara.sharon@intel.com> | 2017-12-19 02:19:32 -0500 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2018-03-28 05:16:03 -0400 |
commit | f4f155e5ec04d381b2f0870817d93dbdc259aa63 (patch) | |
tree | 61215efe9055f5f83acc46ed82e6a441b8fd052b | |
parent | e4d7220813e986a99eff2b98d882d5290dd58078 (diff) |
iwlwifi: mvm: take RCU lock before dereferencing
RCU isn't properly locked.
Fixes: 46d372af9935 ("iwlwifi: mvm: rs: new rate scale API - add FW notifications")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c index 55d1274c6092..fb5745660509 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | |||
@@ -234,13 +234,15 @@ void iwl_mvm_tlc_update_notif(struct iwl_mvm *mvm, struct iwl_rx_packet *pkt) | |||
234 | struct iwl_mvm_sta *mvmsta; | 234 | struct iwl_mvm_sta *mvmsta; |
235 | struct iwl_lq_sta_rs_fw *lq_sta; | 235 | struct iwl_lq_sta_rs_fw *lq_sta; |
236 | 236 | ||
237 | rcu_read_lock(); | ||
238 | |||
237 | notif = (void *)pkt->data; | 239 | notif = (void *)pkt->data; |
238 | mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, notif->sta_id); | 240 | mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, notif->sta_id); |
239 | 241 | ||
240 | if (!mvmsta) { | 242 | if (!mvmsta) { |
241 | IWL_ERR(mvm, "Invalid sta id (%d) in FW TLC notification\n", | 243 | IWL_ERR(mvm, "Invalid sta id (%d) in FW TLC notification\n", |
242 | notif->sta_id); | 244 | notif->sta_id); |
243 | return; | 245 | goto out; |
244 | } | 246 | } |
245 | 247 | ||
246 | lq_sta = &mvmsta->lq_sta.rs_fw; | 248 | lq_sta = &mvmsta->lq_sta.rs_fw; |
@@ -251,6 +253,8 @@ void iwl_mvm_tlc_update_notif(struct iwl_mvm *mvm, struct iwl_rx_packet *pkt) | |||
251 | IWL_DEBUG_RATE(mvm, "new rate_n_flags: 0x%X\n", | 253 | IWL_DEBUG_RATE(mvm, "new rate_n_flags: 0x%X\n", |
252 | lq_sta->last_rate_n_flags); | 254 | lq_sta->last_rate_n_flags); |
253 | } | 255 | } |
256 | out: | ||
257 | rcu_read_unlock(); | ||
254 | } | 258 | } |
255 | 259 | ||
256 | void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, | 260 | void rs_fw_rate_init(struct iwl_mvm *mvm, struct ieee80211_sta *sta, |