diff --git a/net/wireless/chan.c b/net/wireless/chan.c index aaa590c0b491..cf14c7e22fb3 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -593,10 +593,17 @@ static bool cfg80211_secondary_chans_ok(struct wiphy *wiphy, for (freq = start_freq; freq <= end_freq; freq += 20) { c = ieee80211_get_channel(wiphy, freq); - if (!c || c->flags & prohibited_flags) + + if (!c) + return false; + + if ((!(wiphy->flags & WIPHY_FLAG_DFS_OFFLOAD)) && + (c->flags & prohibited_flags & IEEE80211_CHAN_RADAR)) + return false; + + if (c->flags & prohibited_flags & ~IEEE80211_CHAN_RADAR) return false; } - return true; }