netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()'
@ 2021-01-24  7:56 Christophe JAILLET
  2021-01-24  8:09 ` Christophe JAILLET
  0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2021-01-24  7:56 UTC (permalink / raw)
  To: luciano.coelho, kvalo, davem, kuba, mordechay.goodstein,
	johannes.berg, sara.sharon, nathan.errera, Dan1.Halperin,
	emmanuel.grumbach, naftali.goldstein, netdev
  Cc: linux-wireless, linux-kernel, kernel-janitors, Christophe JAILLET

If the 'cmd_ver' check fails, we must release some memory as already done
in all the other error handling paths of this function.

Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index c025188fa9bc..2fb897cbfca6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -810,8 +810,10 @@ static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
 						WOWLAN_KEK_KCK_MATERIAL,
 						IWL_FW_CMD_VER_UNKNOWN);
 		if (WARN_ON(cmd_ver != 2 && cmd_ver != 3 &&
-			    cmd_ver != IWL_FW_CMD_VER_UNKNOWN))
-			return -EINVAL;
+			    cmd_ver != IWL_FW_CMD_VER_UNKNOWN)) {
+			ret = -EINVAL;
+			goto out;
+		}
 		if (cmd_ver == 3)
 			cmd_size = sizeof(struct iwl_wowlan_kek_kck_material_cmd_v3);
 		else
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()'
  2021-01-24  7:56 [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()' Christophe JAILLET
@ 2021-01-24  8:09 ` Christophe JAILLET
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe JAILLET @ 2021-01-24  8:09 UTC (permalink / raw)
  To: luciano.coelho, kvalo, davem, kuba, mordechay.goodstein,
	johannes.berg, sara.sharon, nathan.errera, Dan1.Halperin,
	emmanuel.grumbach, naftali.goldstein, netdev
  Cc: linux-wireless, linux-kernel, kernel-janitors

Le 24/01/2021 à 08:56, Christophe JAILLET a écrit :
> If the 'cmd_ver' check fails, we must release some memory as already done
> in all the other error handling paths of this function.
> 
> Fixes: 9e3c39361a30 ("iwlwifi: mvm: support new KEK KCK api")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
>   drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 ++++--
>   1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> index c025188fa9bc..2fb897cbfca6 100644
> --- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> +++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
> @@ -810,8 +810,10 @@ static int iwl_mvm_wowlan_config_key_params(struct iwl_mvm *mvm,
>   						WOWLAN_KEK_KCK_MATERIAL,
>   						IWL_FW_CMD_VER_UNKNOWN);
>   		if (WARN_ON(cmd_ver != 2 && cmd_ver != 3 &&
> -			    cmd_ver != IWL_FW_CMD_VER_UNKNOWN))
> -			return -EINVAL;
> +			    cmd_ver != IWL_FW_CMD_VER_UNKNOWN)) {
> +			ret = -EINVAL;
> +			goto out;
> +		}
>   		if (cmd_ver == 3)
>   			cmd_size = sizeof(struct iwl_wowlan_kek_kck_material_cmd_v3);
>   		else
> 

NACK.
I'll resend with the correct subject.

CJ

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-24  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-24  7:56 [PATCH] iwlwifi: mvm: Fix an error handling path in 'ebu_dma_start()' Christophe JAILLET
2021-01-24  8:09 ` Christophe JAILLET

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).