diff options
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r-- | net/mac80211/cfg.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 09d96a8f6c2c..808f5fcd1ced 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3285,13 +3285,19 @@ static int ieee80211_cfg_get_channel(struct wiphy *wiphy, | |||
3285 | struct cfg80211_chan_def *chandef) | 3285 | struct cfg80211_chan_def *chandef) |
3286 | { | 3286 | { |
3287 | struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); | 3287 | struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); |
3288 | struct ieee80211_local *local = wiphy_priv(wiphy); | ||
3288 | struct ieee80211_chanctx_conf *chanctx_conf; | 3289 | struct ieee80211_chanctx_conf *chanctx_conf; |
3289 | int ret = -ENODATA; | 3290 | int ret = -ENODATA; |
3290 | 3291 | ||
3291 | rcu_read_lock(); | 3292 | rcu_read_lock(); |
3292 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); | 3293 | if (local->use_chanctx) { |
3293 | if (chanctx_conf) { | 3294 | chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); |
3294 | *chandef = chanctx_conf->def; | 3295 | if (chanctx_conf) { |
3296 | *chandef = chanctx_conf->def; | ||
3297 | ret = 0; | ||
3298 | } | ||
3299 | } else if (local->open_count == local->monitors) { | ||
3300 | *chandef = local->monitor_chandef; | ||
3295 | ret = 0; | 3301 | ret = 0; |
3296 | } | 3302 | } |
3297 | rcu_read_unlock(); | 3303 | rcu_read_unlock(); |