Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55f7435c authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Johannes Berg
Browse files

cfg80211: DFS check dfs_region before usage



Check the DFS region before channel availability check.

Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: default avatarJanusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 6c474799
Loading
Loading
Loading
Loading
+5 −0
Original line number Original line Diff line number Diff line
@@ -5651,8 +5651,13 @@ static int nl80211_start_radar_detection(struct sk_buff *skb,
	struct net_device *dev = info->user_ptr[1];
	struct net_device *dev = info->user_ptr[1];
	struct wireless_dev *wdev = dev->ieee80211_ptr;
	struct wireless_dev *wdev = dev->ieee80211_ptr;
	struct cfg80211_chan_def chandef;
	struct cfg80211_chan_def chandef;
	enum nl80211_dfs_regions dfs_region;
	int err;
	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);
	err = nl80211_parse_chandef(rdev, info, &chandef);
	if (err)
	if (err)
		return err;
		return err;