With NO_VIRTUAL_MONITOR, ieee80211_set_monitor_channel() applies the channel to the interface of the request. While a monitor is running, nl80211_set_wiphy() can send a request without an interface, and sdata is then invalid. A request for another monitor that is down triggers the warning in check_sdata_in_driver(). Reject both requests, since the channel can only be applied to a running monitor. Fixes: 9d40f7e32774 ("wifi: mac80211: add flag to opt out of virtual monitor support") Signed-off-by: Felix Fietkau --- net/mac80211/cfg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 64e2bd0cf124..62f8cf88f8f4 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1155,6 +1155,10 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy, sdata = wiphy_dereference(wiphy, local->monitor_sdata); if (!sdata) goto done; + } else if (!dev) { + return -EOPNOTSUPP; + } else if (!ieee80211_sdata_running(sdata)) { + return -ENETDOWN; } if (rcu_access_pointer(sdata->deflink.conf->chanctx_conf) && -- 2.47.3