lkml.org 
[lkml]   [2021]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] iwlwifi: mvm: Fix an error handling path in 'iwl_mvm_wowlan_config_key_params()'
Date
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>
---
v1->v2: Fix the subject
---
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
\
 
 \ /
  Last update: 2021-01-24 09:15    [W:0.031 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site