From: Michal Kazior Date: Fri, 29 Jun 2012 10:47:03 +0000 (+0200) Subject: cfg80211: refuse to .set_monitor_channel when non-monitors are present X-Git-Tag: firefly_0821_release~3680^2~2381^2~57^2~1^2~64 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=4f03c1ed8901a01ad4abcef95c02c007a2d481c2;p=firefly-linux-kernel-4.4.55.git cfg80211: refuse to .set_monitor_channel when non-monitors are present Having .set_monitor_channel work with non-monitor interfaces running would make interface combinations accounting ambiguous. Signed-off-by: Michal Kazior Signed-off-by: Johannes Berg --- diff --git a/net/wireless/chan.c b/net/wireless/chan.c index 167e7cb60089..019401b0b5e3 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -85,6 +85,8 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, if (!rdev->ops->set_monitor_channel) return -EOPNOTSUPP; + if (!cfg80211_has_monitors_only(rdev)) + return -EBUSY; chan = rdev_freq_to_chan(rdev, freq, chantype); if (!chan)