iwlwifi: pcie: fix mutex leak in gen2 start
authorJohannes Berg <johannes.berg@intel.com>
Wed, 19 Apr 2017 08:26:02 +0000 (10:26 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 20 Apr 2017 04:27:21 +0000 (07:27 +0300)
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>
drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

index ef8f563a48d94a7c75dd7e5ced4d987bf29034b4..ac60a282d6debc1eb2b891ef0fb2b20bf1370df0 100644 (file)
@@ -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);