OSDN Git Service

iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()
authorLuca Coelho <luciano.coelho@intel.com>
Sun, 19 Dec 2021 09:01:28 +0000 (11:01 +0200)
committerKalle Valo <kvalo@kernel.org>
Mon, 20 Dec 2021 18:41:30 +0000 (20:41 +0200)
If iwl_transt_start_hw() failed, we were returning without calling
wiphy_unlock() and rtnl_unlock(), causing a locking imbalance:

drivers/net/wireless/intel/iwlwifi/mvm/ops.c:686:12: warning: context imbalance in 'iwl_mvm_start_get_nvm' - wrong count at exit

Fix that by adding the unlock calls.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211219090128.42417-2-luca@coelho.fi
drivers/net/wireless/intel/iwlwifi/mvm/ops.c

index 9bd869b..3941baa 100644 (file)
@@ -718,6 +718,8 @@ get_nvm_from_fw:
        ret = iwl_trans_start_hw(mvm->trans);
        if (ret) {
                mutex_unlock(&mvm->mutex);
+               wiphy_unlock(mvm->hw->wiphy);
+               rtnl_unlock();
                return ret;
        }