]> www.infradead.org Git - nvme.git/commit
wifi: mac80211: use monitor sdata with driver only if desired
authorJohannes Berg <johannes.berg@intel.com>
Thu, 25 Jul 2024 16:48:36 +0000 (18:48 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 26 Jul 2024 10:30:49 +0000 (12:30 +0200)
commit8f4fa0876231c426f880a2bff25ac49fac67d805
tree2f9b6d22b52922b8a5990079049be622156f846d
parent1722389b0d863056d78287a120a1d6cadb8d4f7b
wifi: mac80211: use monitor sdata with driver only if desired

In commit 0d9c2beed116 ("wifi: mac80211: fix monitor channel
with chanctx emulation") I changed mac80211 to always have an
internal monitor_sdata to have something to have the chanctx
bound to.

However, if the driver didn't also have the WANT_MONITOR flag
this would cause mac80211 to allocate it without telling the
driver (which was intentional) but also use it for later APIs
to the driver without it ever having known about it which was
_not_ intentional.

Check through the code and only use the monitor_sdata in the
relevant places (TX, MU-MIMO follow settings, TX power, and
interface iteration) when the WANT_MONITOR flag is set.

Cc: stable@vger.kernel.org
Fixes: 0d9c2beed116 ("wifi: mac80211: fix monitor channel with chanctx emulation")
Reported-by: ZeroBeat <ZeroBeat@gmx.de>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=219086
Tested-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20240725184836.25d334157a8e.I02574086da2c5cf0e18264ce5807db6f14ffd9c0@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/tx.c
net/mac80211/util.c