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
Subject: [PATCH v5.6 3/7] iwlwifi: check allocated pointer when allocating conf_tlvs
Date: Fri,  6 Mar 2020 15:16:23 +0200	[thread overview]
Message-ID: <iwlwifi.20200306151128.06e00e6e980f.I9a890ce83493b79892a5f690d12016525317fa7e@changeid> (raw)
In-Reply-To: <20200306131627.503176-1-luca@coelho.fi>

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

We were erroneously checking the length of the tlv instead of checking
the pointer returned by kmemdup() when allocating dbg_conf_tlv[].
This was probably a typo.  Fix it by checking the returned pointer
instead of the length.

Reported-by: Markus Elfring <Markus.Elfring@web.de>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-drv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
index 2d1cb4647c3b..0481796f75bc 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
@@ -1467,7 +1467,7 @@ static void iwl_req_fw_callback(const struct firmware *ucode_raw, void *context)
 				kmemdup(pieces->dbg_conf_tlv[i],
 					pieces->dbg_conf_tlv_len[i],
 					GFP_KERNEL);
-			if (!pieces->dbg_conf_tlv_len[i])
+			if (!pieces->dbg_conf_tlv[i])
 				goto out_free_fw;
 		}
 	}
-- 
2.25.1


  parent reply	other threads:[~2020-03-06 13:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 13:16 [PATCH v5.6 0/7] iwlwifi: fixes intended for 5.6 2020-03-06 Luca Coelho
2020-03-06 13:16 ` [PATCH v5.6 1/7] iwlwifi: mvm: take the required lock when clearing time event data Luca Coelho
2020-03-06 13:16 ` [PATCH v5.6 2/7] iwlwifi: consider HE capability when setting LDPC Luca Coelho
2020-03-06 13:16 ` Luca Coelho [this message]
2020-03-06 13:16 ` [PATCH v5.6 4/7] iwlwifi: yoyo: don't add TLV offset when reading FIFOs Luca Coelho
2020-03-06 13:16 ` [PATCH v5.6 5/7] iwlwifi: dbg: don't abort if sending DBGC_SUSPEND_RESUME fails Luca Coelho
2020-03-06 13:16 ` [PATCH v5.6 6/7] iwlwifi: mvm: Fix rate scale NSS configuration Luca Coelho
2020-03-06 13:16 ` [PATCH v5.6 7/7] iwlwifi: cfg: use antenna diversity with all AX101 devices 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=iwlwifi.20200306151128.06e00e6e980f.I9a890ce83493b79892a5f690d12016525317fa7e@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /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).