All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Shahar S Matityahu <shahar.s.matityahu@intel.com>,
	Luca Coelho <luciano.coelho@intel.com>
Subject: [PATCH 3/7] iwlwifi: dbg_ini: in case of region dump failure set memory to 0
Date: Fri,  8 Mar 2019 12:08:44 +0200	[thread overview]
Message-ID: <20190308100848.13188-4-luca@coelho.fi> (raw)
In-Reply-To: <20190308100848.13188-1-luca@coelho.fi>

From: Shahar S Matityahu <shahar.s.matityahu@intel.com>

In case the driver fails to dump a memory region, and this is the last
region, then partial region would be extracted.

Solve this by setting the data to zero in case of failure.
This will cause dump to be a list of consecutive successful memory
regions and trailing zeros with no partial memories extracted.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index f119c49cd39c..da5d9d79c372 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -1614,6 +1614,7 @@ iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt,
 	if (!range) {
 		IWL_ERR(fwrt, "Failed to fill region header: id=%d, type=%d\n",
 			le32_to_cpu(reg->region_id), type);
+		memset(*data, 0, le32_to_cpu((*data)->len));
 		return;
 	}
 
@@ -1623,6 +1624,7 @@ iwl_dump_ini_mem(struct iwl_fw_runtime *fwrt,
 		if (range_size < 0) {
 			IWL_ERR(fwrt, "Failed to dump region: id=%d, type=%d\n",
 				le32_to_cpu(reg->region_id), type);
+			memset(*data, 0, le32_to_cpu((*data)->len));
 			return;
 		}
 		range = range + range_size;
-- 
2.20.1


  parent reply	other threads:[~2019-03-08 10:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-08 10:08 [PATCH 0/7] iwlwifi: fixes intended for 5.1 2019-03-08 Luca Coelho
2019-03-08 10:08 ` [PATCH 1/7] iwlwifi: mvm: fix TX crypto on 22560+ devices Luca Coelho
2019-03-08 10:08 ` [PATCH 2/7] iwlwifi: add sync_nmi to trans ops Luca Coelho
2019-03-08 10:08 ` Luca Coelho [this message]
2019-03-08 10:08 ` [PATCH 4/7] iwlwifi: dbg_ini: fix bad dump size calculation Luca Coelho
2019-03-08 10:08 ` [PATCH 5/7] iwlwifi: use sync nmi in case of init flow failure Luca Coelho
2019-03-08 10:08 ` [PATCH 6/7] iwlwifi: rename structs to fit the new names Luca Coelho
2019-03-08 10:08 ` [PATCH 7/7] iwlwifi: add new 0x2723/0x2080 card for 22000 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=20190308100848.13188-4-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=shahar.s.matityahu@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 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.