summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZiyi Guo <n7l8m4@u.northwestern.edu>2026-01-25 22:40:39 +0300
committerSasha Levin <sashal@kernel.org>2026-03-04 15:21:16 +0300
commit7d355d937dc320f57b46b701ae3eaebd79729830 (patch)
tree8633694642cca7df0db5727fa072e14a05b52849 /drivers
parentb9074687ffeae3efa440b2cab5866524012477f0 (diff)
downloadlinux-7d355d937dc320f57b46b701ae3eaebd79729830.tar.xz
wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power()
[ Upstream commit e31fa691d0b1c07b6094a6cf0cce894192c462b3 ] il4965_store_tx_power() calls il_set_tx_power() without holding il->mutex. However, il_set_tx_power() has lockdep_assert_held(&il->mutex) indicating that callers must hold this lock. All other callers of il_set_tx_power() properly acquire the mutex: - il_bg_scan_completed() acquires mutex at common.c:1683 - il_mac_config() acquires mutex at common.c:5006 - il3945_commit_rxon() and il4965_commit_rxon() are called via work queues that hold the mutex (like il4965_bg_alive_start) Add mutex_lock()/mutex_unlock() around the il_set_tx_power() call in the sysfs store function to fix the missing lock protection. Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Link: https://patch.msgid.link/20260125194039.1196488-1-n7l8m4@u.northwestern.edu Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/intel/iwlegacy/4965-mac.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlegacy/4965-mac.c b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
index a94cf27ffe4b..ac2cfef737e4 100644
--- a/drivers/net/wireless/intel/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/4965-mac.c
@@ -4606,7 +4606,9 @@ il4965_store_tx_power(struct device *d, struct device_attribute *attr,
if (ret)
IL_INFO("%s is not in decimal form.\n", buf);
else {
+ mutex_lock(&il->mutex);
ret = il_set_tx_power(il, val, false);
+ mutex_unlock(&il->mutex);
if (ret)
IL_ERR("failed setting tx power (0x%08x).\n", ret);
else