diff mbox

iwlwifi: pcie: missing unlock on error path

Message ID 20170421103937.jko3eguvfn3i6r3v@mwanda (mailing list archive)
State Superseded
Delegated to: Luca Coelho
Headers show

Commit Message

Dan Carpenter April 21, 2017, 10:39 a.m. UTC
We should unlock before returning.

Fixes: eda50cde58de ("iwlwifi: pcie: add context information support")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Kalle Valo April 21, 2017, 10:43 a.m. UTC | #1
Dan Carpenter <dan.carpenter@oracle.com> writes:

> We should unlock before returning.
>
> Fixes: eda50cde58de ("iwlwifi: pcie: add context information support")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
> index 302310dfef9e..4e84955d55c8 100644
> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
> @@ -212,8 +212,10 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
>  		goto out;
>  	}
>  
> -	if (iwl_pcie_ctxt_info_init(trans, fw))
> -		return -ENOMEM;
> +	if (iwl_pcie_ctxt_info_init(trans, fw)) {
> +		ret = -ENOMEM;
> +		goto out;
> +	}

This was recently fixed:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next.git/commit/?id=97b00d877bb8c2e499b9d0c07b65bd92b4e91ddd
Luca Coelho April 21, 2017, 10:43 a.m. UTC | #2
Hi Dan

On Fri, 2017-04-21 at 13:39 +0300, Dan Carpenter wrote:
> We should unlock before returning.

> 

> Fixes: eda50cde58de ("iwlwifi: pcie: add context information support")

> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

> 

> diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

> index 302310dfef9e..4e84955d55c8 100644

> --- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

> +++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c

> @@ -212,8 +212,10 @@ int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,

>  		goto out;

>  	}

>  

> -	if (iwl_pcie_ctxt_info_init(trans, fw))

> -		return -ENOMEM;

> +	if (iwl_pcie_ctxt_info_init(trans, fw)) {

> +		ret = -ENOMEM;

> +		goto out;

> +	}

>  

>  	/* re-check RF-Kill state since we may have missed the interrupt */

>  	hw_rfkill = iwl_trans_check_hw_rf_kill(trans);


Thanks for your patch! But this has already been fixed by Johannes in
the patch I sent out yesterday[1].

[1] https://www.spinics.net/lists/linux-wireless/msg161582.html

--
Cheers,
Luca.
diff mbox

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
index 302310dfef9e..4e84955d55c8 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans-gen2.c
@@ -212,8 +212,10 @@  int iwl_trans_pcie_gen2_start_fw(struct iwl_trans *trans,
 		goto out;
 	}
 
-	if (iwl_pcie_ctxt_info_init(trans, fw))
-		return -ENOMEM;
+	if (iwl_pcie_ctxt_info_init(trans, fw)) {
+		ret = -ENOMEM;
+		goto out;
+	}
 
 	/* re-check RF-Kill state since we may have missed the interrupt */
 	hw_rfkill = iwl_trans_check_hw_rf_kill(trans);