diff mbox series

iwlwifi: mvm: add rtnl_lock() in iwl_mvm_start_get_nvm()

Message ID 20210902101101.383243-1-luca@coelho.fi (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series iwlwifi: mvm: add rtnl_lock() in iwl_mvm_start_get_nvm() | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Luca Coelho Sept. 2, 2021, 10:11 a.m. UTC
From: Luca Coelho <luciano.coelho@intel.com>

Due to a rebase damage, we lost the rtnl_lock() when the patch was
sent out.  This causes an RTNL imbalance and failed assertions, due to
missing RTNL protection, for instance:

  RTNL: assertion failed at net/wireless/reg.c (4025)
  WARNING: CPU: 60 PID: 1720 at net/wireless/reg.c:4025 regulatory_set_wiphy_regd_sync+0x7f/0x90 [cfg80211]
  Call Trace:
   iwl_mvm_init_mcc+0x170/0x190 [iwlmvm]
   iwl_op_mode_mvm_start+0x824/0xa60 [iwlmvm]
   iwl_opmode_register+0xd0/0x130 [iwlwifi]
   init_module+0x23/0x1000 [iwlmvm]

Fix this by adding the missing rtnl_lock() back to the code.

Fixes: eb09ae93dabf ("iwlwifi: mvm: load regdomain at INIT stage")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 1 +
 1 file changed, 1 insertion(+)
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 6f60018feed1..77ea2d0a3091 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -686,6 +686,7 @@  static int iwl_mvm_start_get_nvm(struct iwl_mvm *mvm)
 {
 	int ret;
 
+	rtnl_lock();
 	mutex_lock(&mvm->mutex);
 
 	ret = iwl_run_init_mvm_ucode(mvm);