[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20260125193005.1090429-1-n7l8m4@u.northwestern.edu>
Date: Sun, 25 Jan 2026 19:30:05 +0000
From: Ziyi Guo <n7l8m4@...orthwestern.edu>
To: Stanislaw Gruszka <stf_xl@...pl>
Cc: linux-wireless@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ziyi Guo <n7l8m4@...orthwestern.edu>
Subject: [PATCH] wifi: iwlegacy: add missing mutex protection in il3945_store_measurement()
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@...orthwestern.edu>
---
drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
index 104748fcdc33..54991f31c52c 100644
--- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c
@@ -3224,7 +3224,9 @@ il3945_store_measurement(struct device *d, struct device_attribute *attr,
D_INFO("Invoking measurement of type %d on " "channel %d (for '%s')\n",
type, params.channel, buf);
+ mutex_lock(&il->mutex);
il3945_get_measurement(il, ¶ms, type);
+ mutex_unlock(&il->mutex);
return count;
}
--
2.34.1
Powered by blists - more mailing lists