diff mbox series

wifi: mac80211: initialize fq.lock as early as possible

Message ID 81f3eeda-0888-2869-659e-dc38c0a9debf@I-love.SAKURA.ne.jp
State New
Headers show
Series wifi: mac80211: initialize fq.lock as early as possible | expand

Commit Message

Tetsuo Handa July 17, 2022, 2:32 a.m. UTC
lockdep complains use of uninitialized spinlock at ieee80211_do_stop() [1],
for commit f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif
that is being stopped") guards clear_bit() using fq.lock even before
fq_init() from ieee80211_txq_setup_flows() initializes this spinlock.
Initialize this spinlock as early as possible.

Link: https://syzkaller.appspot.com/bug?extid=eceab52db7c4b961e9d6 [1]
Reported-by: syzbot <syzbot+eceab52db7c4b961e9d6@syzkaller.appspotmail.com>
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Fixes: f856373e2f31ffd3 ("wifi: mac80211: do not wake queues on a vif that is being stopped")
Tested-by: syzbot <syzbot+eceab52db7c4b961e9d6@syzkaller.appspotmail.com>
---
 net/mac80211/main.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index 5a385d4146b9..584e98300bbf 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -642,6 +642,7 @@  struct ieee80211_hw *ieee80211_alloc_hw_nm(size_t priv_data_len,
 	wiphy->bss_priv_size = sizeof(struct ieee80211_bss);
 
 	local = wiphy_priv(wiphy);
+	spin_lock_init(&local->fq.lock);
 
 	if (sta_info_init(local))
 		goto err_free;