]> Pileus Git - ~andy/linux/commitdiff
cfg80211: DFS check dfs_region before usage
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Mon, 25 Nov 2013 19:56:10 +0000 (20:56 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 3 Dec 2013 12:53:40 +0000 (13:53 +0100)
Check the DFS region before channel availability check.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 93e3356091ff9cfac5937ce633e1a2efffbfbd83..9cd8c6113e94f0e20dd516886b49f888467102ce 100644 (file)
@@ -5651,8 +5651,13 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
        struct net_device *dev = info->user_ptr[1];
        struct wireless_dev *wdev = dev->ieee80211_ptr;
        struct cfg80211_chan_def chandef;
+       enum nl80211_dfs_regions dfs_region;
        int err;
 
+       dfs_region = reg_get_dfs_region(wdev->wiphy);
+       if (dfs_region == NL80211_DFS_UNSET)
+               return -EINVAL;
+
        err = nl80211_parse_chandef(rdev, info, &chandef);
        if (err)
                return err;