]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: iwlegacy: add missing mutex protection in il3945_store_measurement()
authorZiyi Guo <n7l8m4@u.northwestern.edu>
Sun, 25 Jan 2026 19:30:05 +0000 (19:30 +0000)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:29 +0000 (07:20 -0500)
commit0fb80b88276d5d9f4d7c8539d70ea363626028cf
treeeadecf32462b4102bd7a866feeceec2639a15811
parent53ba3e2ef5a0595a5b019cc8f213d9c69071fd95
wifi: iwlegacy: add missing mutex protection in il3945_store_measurement()

[ Upstream commit 4dd1dda65265ecbc9f43ffc08e333684cf715152 ]

il3945_store_measurement() calls il3945_get_measurement() which internally
calls il_send_cmd_sync() without holding il->mutex. However,
il_send_cmd_sync() has lockdep_assert_held(&il->mutex) indicating that
callers must hold this lock.

Other sysfs store functions in the same file properly acquire the mutex:
- il3945_store_flags() acquires mutex at 3945-mac.c:3110
- il3945_store_filter_flags() acquires mutex at 3945-mac.c:3144

Add mutex_lock()/mutex_unlock() around the il3945_get_measurement() 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/20260125193005.1090429-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/3945-mac.c