aboutsummaryrefslogtreecommitdiffstats
path: root/net/wireless/nl80211.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-10-26 11:14:38 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-11-25 14:50:40 -0500
commit00c3a6ed649c3305b52ff51e187717365aa39d4a (patch)
treefafb8473f2265d56e082a54f5d0eca1917d3c2fc /net/wireless/nl80211.c
parent0f0094b3c7b8fef51f1ea6a0abc08b99d1444506 (diff)
cfg80211: don't allow drivers to unset NL80211_FEATURE_SCAN_FLUSH
As the flag is entirely implemented in cfg80211, it should have been a global feature flag (which I believe didn't exist at the time). However, there's no reason to allow drivers to unset the flag, so don't allow it and remove the validation of NL80211_SCAN_FLAG_FLUSH. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r--net/wireless/nl80211.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e2bb4276af1a..1ad11de6dd2f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5342,10 +5342,8 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
5342 if (info->attrs[NL80211_ATTR_SCAN_FLAGS]) { 5342 if (info->attrs[NL80211_ATTR_SCAN_FLAGS]) {
5343 request->flags = nla_get_u32( 5343 request->flags = nla_get_u32(
5344 info->attrs[NL80211_ATTR_SCAN_FLAGS]); 5344 info->attrs[NL80211_ATTR_SCAN_FLAGS]);
5345 if (((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) && 5345 if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) &&
5346 !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) || 5346 !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) {
5347 ((request->flags & NL80211_SCAN_FLAG_FLUSH) &&
5348 !(wiphy->features & NL80211_FEATURE_SCAN_FLUSH))) {
5349 err = -EOPNOTSUPP; 5347 err = -EOPNOTSUPP;
5350 goto out_free; 5348 goto out_free;
5351 } 5349 }
@@ -5585,10 +5583,8 @@ static int nl80211_start_sched_scan(struct sk_buff *skb,
5585 if (info->attrs[NL80211_ATTR_SCAN_FLAGS]) { 5583 if (info->attrs[NL80211_ATTR_SCAN_FLAGS]) {
5586 request->flags = nla_get_u32( 5584 request->flags = nla_get_u32(
5587 info->attrs[NL80211_ATTR_SCAN_FLAGS]); 5585 info->attrs[NL80211_ATTR_SCAN_FLAGS]);
5588 if (((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) && 5586 if ((request->flags & NL80211_SCAN_FLAG_LOW_PRIORITY) &&
5589 !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) || 5587 !(wiphy->features & NL80211_FEATURE_LOW_PRIORITY_SCAN)) {
5590 ((request->flags & NL80211_SCAN_FLAG_FLUSH) &&
5591 !(wiphy->features & NL80211_FEATURE_SCAN_FLUSH))) {
5592 err = -EOPNOTSUPP; 5588 err = -EOPNOTSUPP;
5593 goto out_free; 5589 goto out_free;
5594 } 5590 }