diff mbox series

[4/4] iwlwifi: mvm: fix imbalanced locking in iwl_mvm_start_get_nvm()

Message ID 20211219090128.42417-2-luca@coelho.fi
State New
Headers show
Series iwlwifi: fixes for new W=1 warnings and errors | expand

Commit Message

Luca Coelho Dec. 19, 2021, 9:01 a.m. UTC
From: Luca Coelho <luciano.coelho@intel.com>

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>
---
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 9bd869b8a974..3941baa3eda3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -718,6 +718,8 @@  static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm)
 	ret = iwl_trans_start_hw(mvm->trans);
 	if (ret) {
 		mutex_unlock(&mvm->mutex);
+		wiphy_unlock(mvm->hw->wiphy);
+		rtnl_unlock();
 		return ret;
 	}