Skip to contentSkip to conversation

wifi: iwlwifi: pcie: unlock on error in iwl_trans_pcie_gen2_start_fw()

PATCH In review Dan Carpenter 2 participants 2 messages Jun 25, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: iwlwifi: pcie: unlock on error in iwl_trans_pcie_gen2_start_fw()

We need to call mutex_unlock(&trans_pcie->mutex) before returning on this error path.

Fixes aeee73e27f2d ("wifi: iwlwifi: pcie: move generation specific files to a folder")
---
 drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c +4 -2
index 0df8522ca410..8ff23f3931c6 100644
@@ -546,8 +546,10 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
 	}
 
 	if (WARN_ON(trans->do_top_reset &&
-		    trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_SC))
-		return -EINVAL;
+		    trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_SC)) {
+		ret = -EINVAL;
+		goto out;
+	}
 
 	/* we need to wait later - set state */
 	if (trans->do_top_reset)
Signature · 1 line
2.47.2
#1 lore raw
Quoted 34 lines

Subject: [PATCH] wifi: iwlwifi: pcie: unlock on error in iwl_trans_pcie_gen2_start_fw()

We need to call mutex_unlock(&trans_pcie->mutex) before returning on this error path.

Fixes aeee73e27f2d ("wifi: iwlwifi: pcie: move generation specific files to a

folder")

---
 drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c +4 -2
index 0df8522ca410..8ff23f3931c6 100644
@@ -546,8 +546,10 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans
 *trans,
 	}
 
 	if (WARN_ON(trans->do_top_reset &&
-		    trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_SC))
-		return -EINVAL;
+		    trans->mac_cfg->device_family < IWL_DEVICE_FAMILY_SC))
 {
+		ret = -EINVAL;
+		goto out;
+	}
 
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/trans-gen2.c +0 -1
 	/* we need to wait later - set state */
 	if (trans->do_top_reset)
--
Quoted 1 line

2.47.2

Hi Dan,

Thanks for your patch, but we already have such a patch internally, which will be sent soon.

Miri