ATH11K Archive mirror
 help / color / mirror / Atom feed
* [PATCH] wifi: ath11k: initialize eirp_power before use
@ 2024-02-02  2:40 Baochen Qiang
  2024-02-02 17:35 ` Jeff Johnson
  2024-02-05 17:00 ` Kalle Valo
  0 siblings, 2 replies; 3+ messages in thread
From: Baochen Qiang @ 2024-02-02  2:40 UTC (permalink / raw
  To: ath11k; +Cc: linux-wireless, quic_bqiang

Currently, at the end of ath11k_mac_fill_reg_tpc_info(), the
reg_tpc_info struct is populated, including the following:
	reg_tpc_info->is_psd_power = is_psd_power;
	reg_tpc_info->eirp_power = eirp_power;

Kernel test robot complains on uninitialized symbol:
drivers/net/wireless/ath/ath11k/mac.c:7949
ath11k_mac_fill_reg_tpc_info() error: uninitialized symbol 'eirp_power'.

This is because there are some code paths that never set eirp_power, so
the assignment of reg_tpc_info->eirp_power can come from an
uninitialized variable. Functionally this is OK since the eirp_power
only has meaning when is_psd_power is true, and all code paths which set
is_psd_power to true also set eirp_power. However, to keep the robot
happy, always initialize eirp_power before use.

Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23

Fixes: 92425f788fee ("wifi: ath11k: fill parameters for vdev set tpc power WMI command")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202401311243.NyXwWZxP-lkp@intel.com/
Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/mac.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index bbf4d1f4d310..310055843ee9 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7592,7 +7592,8 @@ void ath11k_mac_fill_reg_tpc_info(struct ath11k *ar,
 	u8 pwr_lvl_idx, num_pwr_levels, pwr_reduction;
 	bool is_psd_power = false, is_tpe_present = false;
 	s8 max_tx_power[IEEE80211_MAX_NUM_PWR_LEVEL],
-		psd_power, tx_power, eirp_power;
+		psd_power, tx_power;
+	s8 eirp_power = 0;
 	u16 start_freq, center_freq;
 
 	chan = ctx->def.chan;

base-commit: d4d13947306ab3c98c84389d9397563b550b71b8
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: ath11k: initialize eirp_power before use
  2024-02-02  2:40 [PATCH] wifi: ath11k: initialize eirp_power before use Baochen Qiang
@ 2024-02-02 17:35 ` Jeff Johnson
  2024-02-05 17:00 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Johnson @ 2024-02-02 17:35 UTC (permalink / raw
  To: Baochen Qiang, ath11k; +Cc: linux-wireless

On 2/1/2024 6:40 PM, Baochen Qiang wrote:
> Currently, at the end of ath11k_mac_fill_reg_tpc_info(), the
> reg_tpc_info struct is populated, including the following:
> 	reg_tpc_info->is_psd_power = is_psd_power;
> 	reg_tpc_info->eirp_power = eirp_power;
> 
> Kernel test robot complains on uninitialized symbol:
> drivers/net/wireless/ath/ath11k/mac.c:7949
> ath11k_mac_fill_reg_tpc_info() error: uninitialized symbol 'eirp_power'.
> 
> This is because there are some code paths that never set eirp_power, so
> the assignment of reg_tpc_info->eirp_power can come from an
> uninitialized variable. Functionally this is OK since the eirp_power
> only has meaning when is_psd_power is true, and all code paths which set
> is_psd_power to true also set eirp_power. However, to keep the robot
> happy, always initialize eirp_power before use.
> 
> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Fixes: 92425f788fee ("wifi: ath11k: fill parameters for vdev set tpc power WMI command")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401311243.NyXwWZxP-lkp@intel.com/
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] wifi: ath11k: initialize eirp_power before use
  2024-02-02  2:40 [PATCH] wifi: ath11k: initialize eirp_power before use Baochen Qiang
  2024-02-02 17:35 ` Jeff Johnson
@ 2024-02-05 17:00 ` Kalle Valo
  1 sibling, 0 replies; 3+ messages in thread
From: Kalle Valo @ 2024-02-05 17:00 UTC (permalink / raw
  To: Baochen Qiang; +Cc: ath11k, linux-wireless, quic_bqiang

Baochen Qiang <quic_bqiang@quicinc.com> wrote:

> Currently, at the end of ath11k_mac_fill_reg_tpc_info(), the
> reg_tpc_info struct is populated, including the following:
>         reg_tpc_info->is_psd_power = is_psd_power;
>         reg_tpc_info->eirp_power = eirp_power;
> 
> Kernel test robot complains on uninitialized symbol:
> drivers/net/wireless/ath/ath11k/mac.c:7949
> ath11k_mac_fill_reg_tpc_info() error: uninitialized symbol 'eirp_power'.
> 
> This is because there are some code paths that never set eirp_power, so
> the assignment of reg_tpc_info->eirp_power can come from an
> uninitialized variable. Functionally this is OK since the eirp_power
> only has meaning when is_psd_power is true, and all code paths which set
> is_psd_power to true also set eirp_power. However, to keep the robot
> happy, always initialize eirp_power before use.
> 
> Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
> 
> Fixes: 92425f788fee ("wifi: ath11k: fill parameters for vdev set tpc power WMI command")
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202401311243.NyXwWZxP-lkp@intel.com/
> Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

b82fb7ef690b wifi: ath11k: initialize eirp_power before use

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240202024011.11341-1-quic_bqiang@quicinc.com/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-05 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-02  2:40 [PATCH] wifi: ath11k: initialize eirp_power before use Baochen Qiang
2024-02-02 17:35 ` Jeff Johnson
2024-02-05 17:00 ` Kalle Valo

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 read-only IMAP folder(s) and NNTP newsgroup(s).