All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@kernel.org
Cc: luca@coelho.fi, linux-wireless@vger.kernel.org
Subject: [PATCH 02/12] iwlwifi: yoyo: Avoid using dram data if allocation failed
Date: Fri,  4 Feb 2022 12:25:01 +0200	[thread overview]
Message-ID: <iwlwifi.20220204122220.44835d181528.I3e78ba29c13bbeada017fcb2a620f3552c1dfa30@changeid> (raw)
In-Reply-To: <20220204102511.606112-1-luca@coelho.fi>

From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>

The config set TLV setting depend on dram allocation
and if allocation failed the data used in config set tlv
should not set this.
Adding the check if dram fragment is available or not.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Fixes: 1a5daead217c ("iwlwifi: yoyo: support for ROM usniffer")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
index 1e884dc31f46..0cda8ac5024f 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c
@@ -875,11 +875,18 @@ static void iwl_dbg_tlv_apply_config(struct iwl_fw_runtime *fwrt,
 		case IWL_FW_INI_CONFIG_SET_TYPE_DBGC_DRAM_ADDR: {
 			struct iwl_dbgc1_info dram_info = {};
 			struct iwl_dram_data *frags = &fwrt->trans->dbg.fw_mon_ini[1].frags[0];
-			__le64 dram_base_addr = cpu_to_le64(frags->physical);
-			__le32 dram_size = cpu_to_le32(frags->size);
-			u64  dram_addr = le64_to_cpu(dram_base_addr);
+			__le64 dram_base_addr;
+			__le32 dram_size;
+			u64 dram_addr;
 			u32 ret;
 
+			if (!frags)
+				break;
+
+			dram_base_addr = cpu_to_le64(frags->physical);
+			dram_size = cpu_to_le32(frags->size);
+			dram_addr = le64_to_cpu(dram_base_addr);
+
 			IWL_DEBUG_FW(fwrt, "WRT: dram_base_addr 0x%016llx, dram_size 0x%x\n",
 				     dram_base_addr, dram_size);
 			IWL_DEBUG_FW(fwrt, "WRT: config_list->addr_offset: %u\n",
-- 
2.34.1


  parent reply	other threads:[~2022-02-04 10:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 10:24 [PATCH 00/12] iwlwifi: updates intended for v5.18 2022-02-04 Luca Coelho
2022-02-04 10:25 ` [PATCH 01/12] iwlwifi: mvm: Correctly set fragmented EBS Luca Coelho
2022-02-04 10:25 ` Luca Coelho [this message]
2022-02-04 10:25 ` [PATCH 03/12] iwlwifi: scan: Modify return value of a function Luca Coelho
2022-02-04 10:25 ` [PATCH 04/12] iwlwifi: mvm: Passively scan non PSC channels only when requested so Luca Coelho
2022-03-25 17:11   ` Ben Greear
2022-04-04 19:02     ` Peer, Ilan
2022-04-05 19:05       ` Ben Greear
2022-04-06  6:22         ` Peer, Ilan
2022-02-04 10:25 ` [PATCH 05/12] iwlwifi: pcie: adjust to Bz completion descriptor Luca Coelho
2022-02-04 10:25 ` [PATCH 06/12] iwlwifi: pcie: Adapt rx queue write pointer for Bz family Luca Coelho
2022-02-04 10:25 ` [PATCH 07/12] iwlwifi: drv: load tlv debug data earlier Luca Coelho
2022-02-04 10:25 ` [PATCH 08/12] iwlwifi: eeprom: clean up macros Luca Coelho
2022-02-04 10:25 ` [PATCH 09/12] iwlwifi: remove unused macros Luca Coelho
2022-02-04 10:25 ` [PATCH 10/12] iwlwifi: debugfs: remove useless double condition Luca Coelho
2022-02-04 10:25 ` [PATCH 11/12] iwlwifi: mei: use C99 initializer for device IDs Luca Coelho
2022-02-04 10:25 ` [PATCH 12/12] iwlwifi: mvm: Unify the scan iteration functions 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.20220204122220.44835d181528.I3e78ba29c13bbeada017fcb2a620f3552c1dfa30@changeid \
    --to=luca@coelho.fi \
    --cc=kvalo@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.