linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org, Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 12/17] iwlwifi: mvm: pre-initialize alive_data in wait_alive()
Date: Fri, 25 Jan 2019 22:13:00 +0200	[thread overview]
Message-ID: <20190125201305.5616-13-luca@coelho.fi> (raw)
In-Reply-To: <20190125201305.5616-1-luca@coelho.fi>

From: Luca Coelho <luciano.coelho@intel.com>

The function we pass to the wait alive notification procedure may may
not even get called if the timeout occurs before the function is
called.  To prevent accessing unitialized data in alive_data, pre-set
it to zero in the declaration.  Found by static analyzers.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index 27582d70d45a..d3dc9d276e0f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -293,7 +293,7 @@ static int iwl_mvm_load_ucode_wait_alive(struct iwl_mvm *mvm,
 					 enum iwl_ucode_type ucode_type)
 {
 	struct iwl_notification_wait alive_wait;
-	struct iwl_mvm_alive_data alive_data;
+	struct iwl_mvm_alive_data alive_data = {};
 	const struct fw_img *fw;
 	int ret;
 	enum iwl_ucode_type old_type = mvm->fwrt.cur_fw_img;
-- 
2.20.1


  parent reply	other threads:[~2019-01-25 20:22 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-25 20:12 [PATCH 00/17] iwlwifi: updates intended for v5.1 2019-01-25 Luca Coelho
2019-01-25 20:12 ` [PATCH 01/17] iwlwifi: pcie: fix the use of a wrong define Luca Coelho
2019-01-25 20:12 ` [PATCH 02/17] iwlwifi: iwlmvm: ignore HE PPDU type regarding EOF Luca Coelho
2019-01-25 20:12 ` [PATCH 03/17] iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vec Luca Coelho
2019-01-25 20:12 ` [PATCH 04/17] iwlwifi: pcie: add prints to track virtual ID Luca Coelho
2019-01-25 20:12 ` [PATCH 05/17] iwlwifi: mvm: fix %16 to %016 print format Luca Coelho
2019-01-25 20:12 ` [PATCH 06/17] iwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCK Luca Coelho
2019-01-25 20:12 ` [PATCH 07/17] iwlwifi: pcie: align licensing to dual GPL/BSD Luca Coelho
2019-01-25 20:12 ` [PATCH 08/17] iwlwifi: mvm: clean up LDBG config command usage Luca Coelho
2019-01-25 20:12 ` [PATCH 09/17] iwlwifi: mvm: save and export regdb blob from the NVM Luca Coelho
2019-01-25 20:12 ` [PATCH 10/17] iwlwifi: make iwl_fw_dbg_start_stop_hcmd() inline Luca Coelho
2019-01-25 20:12 ` [PATCH 11/17] iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.h Luca Coelho
2019-01-25 20:13 ` Luca Coelho [this message]
2019-01-25 20:13 ` [PATCH 13/17] iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdr Luca Coelho
2019-01-25 20:13 ` [PATCH 14/17] iwlwifi: make sure cur_fw_img is valid before accessing img Luca Coelho
2019-01-25 20:13 ` [PATCH 15/17] iwlwifi: mvm: remove sta key on wep ap Luca Coelho
2019-01-25 20:13 ` [PATCH 16/17] iwlwifi: monitor dumping flow cleanup Luca Coelho
2019-01-25 20:13 ` [PATCH 17/17] iwlwifi: mvm: add an option to dereference vif by id Luca Coelho
2019-01-28  9:00   ` Kalle Valo
2019-01-28  9:04     ` Luca Coelho

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=20190125201305.5616-13-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@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).