]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
iwlwifi: mvm: fix accessing fw_id_to_mac_id
authorSara Sharon <sara.sharon@intel.com>
Thu, 26 Jan 2017 12:43:32 +0000 (14:43 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Fri, 24 Mar 2017 14:59:46 +0000 (16:59 +0200)
Access should be by rcu_dereference. Issue was found by sparse.

Fixes: 65e254821cee ("iwlwifi: mvm: use firmware station PM notification for AP_LINK_PS")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c

index 6927caecd48e515557d011491463c48a3b1ea95c..486dcceed17a4f3a5b1ff0084d8a1f6b768199cd 100644 (file)
@@ -2401,7 +2401,7 @@ void iwl_mvm_sta_pm_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
                return;
 
        rcu_read_lock();
-       sta = mvm->fw_id_to_mac_id[notif->sta_id];
+       sta = rcu_dereference(mvm->fw_id_to_mac_id[notif->sta_id]);
        if (WARN_ON(IS_ERR_OR_NULL(sta))) {
                rcu_read_unlock();
                return;