[PATCH 6.1] wifi: iwlwifi: assume known PNVM power table size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In 'iwl_pnvm_load()', assume that the power table size is always
equal to IWL_HARDCODED_REDUCE_POWER_SIZE. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@xxxxxxxxx>
---
I would gently ask Johannes to review this before taking any other
actions. This is intended for stable linux-6.1.y only in attempt to
avoid possible use of an uninitialized 'len' without backporting
https://lore.kernel.org/linux-wireless/20230606074310.889520-1-gregory.greenman@xxxxxxxxx.
---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
index b6d3ac6ed440..ddf7acd67e94 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
@@ -332,6 +332,9 @@ int iwl_pnvm_load(struct iwl_trans *trans,
 
 			goto skip_reduce_power;
 		}
+	} else {
+		/* see iwl_uefi_get_reduced_power() to check why */
+		len = IWL_HARDCODED_REDUCE_POWER_SIZE;
 	}
 
 	ret = iwl_trans_set_reduce_power(trans, data, len);
-- 
2.48.1




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux