Skip to contentSkip to conversation

Patch "iwlwifi: tt: move ucode_loaded check under mutex" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

iwlwifi: tt: move ucode_loaded check under mutex

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
iwlwifi-tt-move-ucode_loaded-check-under-mutex.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Apr 9 17:09:24 CEST 2018

From: Johannes Berg <[email protected]>
Date: Wed, 22 Mar 2017 22:00:10 +0100
Subject: iwlwifi: tt: move ucode_loaded check under mutex

From: Johannes Berg <[email protected]>

[ Upstream commit d9954405758a0cbbe258d9b4d4dc12a06fa48a28 ]

The ucode_loaded check should be under the mutex, since it can otherwise change state after we looked at it and before we got the mutex. Fix that.

Fixes 5c89e7bc557e ("iwlwifi: mvm: add registration to cooling device")
---
 drivers/net/wireless/intel/iwlwifi/mvm/tt.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/tt.c +5 -3
@@ -790,11 +790,13 @@ static int iwl_mvm_tcool_set_cur_state(s
 	struct iwl_mvm *mvm = (struct iwl_mvm *)(cdev->devdata);
 	int ret;
 
-	if (!mvm->ucode_loaded || !(mvm->cur_ucode == IWL_UCODE_REGULAR))
-		return -EIO;
-
 	mutex_lock(&mvm->mutex);
 
+	if (!mvm->ucode_loaded || !(mvm->cur_ucode == IWL_UCODE_REGULAR)) {
+		ret = -EIO;
+		goto unlock;
+	}
+
 	if (new_state >= ARRAY_SIZE(iwl_mvm_cdev_budgets)) {
 		ret = -EINVAL;
 		goto unlock;

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/cfg80211-make-rate_info_bw_20-the-default.patch queue-4.9/iwlwifi-tt-move-ucode_loaded-check-under-mutex.patch queue-4.9/mac80211-fix-setting-tx-power-on-monitor-interfaces.patch queue-4.9/mac80211-bail-out-from-prep_connection-if-a-reconfig-is-ongoing.patch