]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: iwlegacy: add missing mutex protection in il4965_store_tx_power()
authorZiyi Guo <n7l8m4@u.northwestern.edu>
Sun, 25 Jan 2026 19:40:39 +0000 (19:40 +0000)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:29 +0000 (07:20 -0500)
commit53ba3e2ef5a0595a5b019cc8f213d9c69071fd95
treee1512081eb03fc4c9390a23af9fd16a03cfd77ac
parent7f7f9cc3068c2af2bd1e6f4393ad32ca00bf6171
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>
drivers/net/wireless/intel/iwlegacy/4965-mac.c