wifi: mac80211: check for station first in client probe
authorJohannes Berg <johannes.berg@intel.com>
Tue, 15 Aug 2023 16:41:32 +0000 (18:41 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 09:11:03 +0000 (11:11 +0200)
commit7e1cda5cf07f848e6b50b4e5e7761ffbce905a3d
treea48ba8b5234ecb7871a8f7e6deee82efe7a8d3aa
parentd7b0fe3487d203c04ee1bda91a63bd4dd398c350
wifi: mac80211: check for station first in client probe

[ Upstream commit 67dfa589aa8806c7959cbca2f4613b8d41c75a06 ]

When probing a client, first check if we have it, and then
check for the channel context, otherwise you can trigger
the warning there easily by probing when the AP isn't even
started yet. Since a client existing means the AP is also
operating, we can then keep the warning.

Also simplify the moved code a bit.

Reported-by: syzbot+999fac712d84878a7379@syzkaller.appspotmail.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/mac80211/cfg.c