From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: luciano.coelho@intel.com, kvalo@codeaurora.org,
davem@davemloft.net, kuba@kernel.org,
mordechay.goodstein@intel.com, johannes.berg@intel.com,
sara.sharon@intel.com, nathan.errera@intel.com,
Dan1.Halperin@intel.com, emmanuel.grumbach@intel.com,
naftali.goldstein@intel.com, netdev@vger.kernel.org
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: [PATCH v2] iwlwifi: mvm: Fix an error handling path in 'iwl_mvm_wowlan_config_key_params()'
Date: Sun, 24 Jan 2021 09:11:07 +0100 [thread overview]
Message-ID: <20210124081107.732360-1-christophe.jaillet@wanadoo.fr> (raw)
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
reply other threads:[~2021-01-24 8:13 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210124081107.732360-1-christophe.jaillet@wanadoo.fr \
--to=christophe.jaillet@wanadoo.fr \
--cc=Dan1.Halperin@intel.com \
--cc=davem@davemloft.net \
--cc=emmanuel.grumbach@intel.com \
--cc=johannes.berg@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=luciano.coelho@intel.com \
--cc=mordechay.goodstein@intel.com \
--cc=naftali.goldstein@intel.com \
--cc=nathan.errera@intel.com \
--cc=netdev@vger.kernel.org \
--cc=sara.sharon@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).