linux/drivers/net/wireless/mediatek/mt76/mt7915
Ziyi Guo f0168f2f9a wifi: mt76: add missing lock protection in mt76_sta_state for sta_event callback
mt76_sta_state() calls the sta_event callback without holding dev->mutex.
However, mt7915_mac_sta_event() (MT7915 implementation of this callback)
calls mt7915_mac_twt_teardown_flow() which has
lockdep_assert_held(&dev->mt76.mutex) indicating that callers must
hold this lock.

The locking pattern in mt76_sta_state() is inconsistent:
- mt76_sta_add() acquires dev->mutex before calling dev->drv->sta_add
- mt76_sta_remove() acquires dev->mutex before calling __mt76_sta_remove
- But sta_event callback is called without acquiring the lock

Add mutex_lock()/mutex_unlock() around the mt7915_mac_twt_teardown_flow
invocation to fix the missing lock protection and maintain consistency
with the existing locking pattern.

Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu>
Link: https://patch.msgid.link/20260131035210.2198259-1-n7l8m4@u.northwestern.edu
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2026-03-24 15:49:30 +00:00
..
coredump.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
coredump.h wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
debugfs.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
dma.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
eeprom.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
eeprom.h wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
init.c wifi: mt76: mt7915: fix use-after-free bugs in mt7915_mac_dump_work() 2026-03-24 15:49:30 +00:00
Kconfig wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
mac.c wifi: mt76: mt7915: fix use_cts_prot support 2026-03-23 09:21:25 +00:00
mac.h wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
main.c wifi: mt76: add missing lock protection in mt76_sta_state for sta_event callback 2026-03-24 15:49:30 +00:00
Makefile wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
mcu.c wifi: mt76: Fix memory leak after mt76_connac_mcu_alloc_sta_req() 2026-03-23 09:23:01 +00:00
mcu.h wifi: mt76: mt7915: fix use_cts_prot support 2026-03-23 09:21:25 +00:00
mmio.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
mt7915.h wifi: mt76: mt7915: fix use_cts_prot support 2026-03-23 09:21:25 +00:00
pci.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
regs.h wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
soc.c wifi: mt76: Use of_reserved_mem_region_to_resource() for "memory-region" 2025-11-24 14:37:55 +01:00
testmode.c wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00
testmode.h wifi: mt76: relicense to BSD-3-Clause-Clear 2025-11-24 14:37:54 +01:00