Browse Source

iwlwifi: pcie: fix mutex leak in gen2 start

If the context info fails to be allocated, the mutex
isn't unlocked properly, fix that.

Fixes: eda50cde58de ("iwlwifi: pcie: add context information support")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Johannes Berg 8 năm trước cách đây
mục cha
commit
97b00d877b
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 3 2
      drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

+ 3 - 2
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

@@ -359,8 +359,9 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
 		goto out;
 	}
 
-	if (iwl_pcie_ctxt_info_init(trans, fw))
-		return -ENOMEM;
+	ret = iwl_pcie_ctxt_info_init(trans, fw);
+	if (ret)
+		goto out;
 
 	/* re-check RF-Kill state since we may have missed the interrupt */
 	hw_rfkill = iwl_trans_check_hw_rf_kill(trans);