iwlwifi: mvm: don't call iwl_mvm_free_inactive_queue() under RCU
authorJohannes Berg <johannes.berg@intel.com>
Fri, 3 Apr 2020 08:29:55 +0000 (11:29 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 23 Jun 2020 08:24:48 +0000 (11:24 +0300)
iwl_mvm_free_inactive_queue() will sleep in synchronize_net() under
some circumstances, so don't call it under RCU. There doesn't appear
to be a need for RCU protection around this particular call.

Cc: stable@vger.kernel.org # v5.4+
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/iwlwifi.20200403112332.0f49448c133d.I17fd308bc4a9491859c9b112f4eb5d2c3fc18d7d@changeid
drivers/net/wireless/intel/iwlwifi/mvm/sta.c

index fee01cbbd3ace83d21d8a3f95a1ce1b79a2598a4..27977992fd7fa2c1bcf10c7eb783f0a2ef5fba88 100644 (file)
@@ -1189,17 +1189,15 @@ static int iwl_mvm_inactivity_check(struct iwl_mvm *mvm, u8 alloc_for_sta)
        for_each_set_bit(i, &changetid_queues, IWL_MAX_HW_QUEUES)
                iwl_mvm_change_queue_tid(mvm, i);
 
+       rcu_read_unlock();
+
        if (free_queue >= 0 && alloc_for_sta != IWL_MVM_INVALID_STA) {
                ret = iwl_mvm_free_inactive_queue(mvm, free_queue, queue_owner,
                                                  alloc_for_sta);
-               if (ret) {
-                       rcu_read_unlock();
+               if (ret)
                        return ret;
-               }
        }
 
-       rcu_read_unlock();
-
        return free_queue;
 }