Skip to content
/ linux Public

Commit 998e57c

Browse files
haruki3hhhSasha Levin
authored andcommitted
wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power()
[ Upstream commit e31fa69 ] 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>
1 parent 6b36e5c commit 998e57c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/net/wireless/intel/iwlegacy/4965-mac.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4606,7 +4606,9 @@ il4965_store_tx_power(struct device *d, struct device_attribute *attr,
46064606
if (ret)
46074607
IL_INFO("%s is not in decimal form.\n", buf);
46084608
else {
4609+
mutex_lock(&il->mutex);
46094610
ret = il_set_tx_power(il, val, false);
4611+
mutex_unlock(&il->mutex);
46104612
if (ret)
46114613
IL_ERR("failed setting tx power (0x%08x).\n", ret);
46124614
else

0 commit comments

Comments
 (0)