Skip to content

Commit 70105d9

Browse files
committed
wifi: ath12k: initialize eirp_power before use
JIRA: https://issues.redhat.com/browse/RHEL-114889 commit bba2f9f Author: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Date: Mon Aug 4 11:03:10 2025 +0800 wifi: ath12k: initialize eirp_power before use Currently, at the end of ath12k_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/ath12k/mac.c:10069 ath12k_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: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00284-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1 Fixes: aeda163 ("wifi: ath12k: fill parameters for vdev set TPC power WMI command") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/r/202505180927.tbNWr3vE-lkp@intel.com/ Signed-off-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250804-ath12k-fix-smatch-warning-on-6g-vlp-v1-1-56f1e54152ab@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
1 parent 7aaa9e6 commit 70105d9

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+2
-2
lines changed

drivers/net/wireless/ath/ath12k/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11240,8 +11240,8 @@ void ath12k_mac_fill_reg_tpc_info(struct ath12k *ar,
1124011240
struct ieee80211_channel *chan, *temp_chan;
1124111241
u8 pwr_lvl_idx, num_pwr_levels, pwr_reduction;
1124211242
bool is_psd_power = false, is_tpe_present = false;
11243-
s8 max_tx_power[ATH12K_NUM_PWR_LEVELS],
11244-
psd_power, tx_power, eirp_power;
11243+
s8 max_tx_power[ATH12K_NUM_PWR_LEVELS], psd_power, tx_power;
11244+
s8 eirp_power = 0;
1124511245
struct ath12k_vif *ahvif = arvif->ahvif;
1124611246
u16 start_freq, center_freq;
1124711247
u8 reg_6ghz_power_mode;

0 commit comments

Comments
 (0)