summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath
diff options
context:
space:
mode:
authorBaochen Qiang <quic_bqiang@quicinc.com>2024-02-02 10:40:11 +0800
committerKalle Valo <quic_kvalo@quicinc.com>2024-02-05 19:00:51 +0200
commitb82fb7ef690bd929b88d9aab1d191ff502ed9029 (patch)
tree2cdf874719911f969486fc4d19de9fac5fe7b82a /drivers/net/wireless/ath
parentb802e7b7e771dee3377d071418281f8b64d2d832 (diff)
downloadlinux-stable-b82fb7ef690bd929b88d9aab1d191ff502ed9029.tar.gz
linux-stable-b82fb7ef690bd929b88d9aab1d191ff502ed9029.tar.bz2
linux-stable-b82fb7ef690bd929b88d9aab1d191ff502ed9029.zip
wifi: ath11k: initialize eirp_power before use
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> Link: https://msgid.link/20240202024011.11341-1-quic_bqiang@quicinc.com
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r--drivers/net/wireless/ath/ath11k/mac.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c
index 10cfb60e14a0..dc2bf13f00c1 100644
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -7597,7 +7597,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;