diff mbox series

[03/24] iwlwifi: dbg_ini: fix iwl_dump_ini_dev_mem_iter memory base address

Message ID 20190322135903.10631-4-luca@coelho.fi (mailing list archive)
State Accepted
Delegated to: Luca Coelho
Headers show
Series iwlwifi: updates intended for v5.2 2019-03-22 | expand

Commit Message

Luca Coelho March 22, 2019, 1:58 p.m. UTC
From: Shahar S Matityahu <shahar.s.matityahu@intel.com>

The driver is using range->start_addr before assigning it a value.
Set value into range->start_addr and then use it.

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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
index caf860b7afff..4beec863197e 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/dbg.c
@@ -1090,10 +1090,10 @@  static int iwl_dump_ini_dev_mem_iter(struct iwl_fw_runtime *fwrt,
 				     void *range_ptr, int idx)
 {
 	struct iwl_fw_ini_error_dump_range *range = range_ptr;
-	u32 addr = le32_to_cpu(range->start_addr);
-	u32 offset = le32_to_cpu(reg->offset);
+	u32 addr, offset = le32_to_cpu(reg->offset);
 
 	range->start_addr = reg->start_addr[idx];
+	addr = le32_to_cpu(range->start_addr);
 	range->range_data_size = reg->internal.range_data_size;
 	iwl_trans_read_mem_bytes(fwrt->trans, addr + offset, range->data,
 				 le32_to_cpu(reg->internal.range_data_size));