diff options
author | Luis R. Rodriguez <lrodriguez@atheros.com> | 2011-05-27 10:24:02 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-06-01 15:36:30 -0400 |
commit | 180cdc79c2204d0abe15509689dde631290f6a95 (patch) | |
tree | d91d1cb7040ac01ab5a54e30c586465c759ff56a /net/wireless | |
parent | 84288044dc9a50d2c0b0f1a024d7cd87ab3dd131 (diff) |
cfg80211: skip disabled channels on channel survey
The channel survey information will be empy for
disabled channels so simply discard those entries.
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless')
-rw-r--r-- | net/wireless/nl80211.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 6d0d44b19ee6..70cbc8ca371e 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -3754,10 +3754,6 @@ static int nl80211_send_survey(struct sk_buff *msg, u32 pid, u32 seq, | |||
3754 | void *hdr; | 3754 | void *hdr; |
3755 | struct nlattr *infoattr; | 3755 | struct nlattr *infoattr; |
3756 | 3756 | ||
3757 | /* Survey without a channel doesn't make sense */ | ||
3758 | if (!survey->channel) | ||
3759 | return -EINVAL; | ||
3760 | |||
3761 | hdr = nl80211hdr_put(msg, pid, seq, flags, | 3757 | hdr = nl80211hdr_put(msg, pid, seq, flags, |
3762 | NL80211_CMD_NEW_SURVEY_RESULTS); | 3758 | NL80211_CMD_NEW_SURVEY_RESULTS); |
3763 | if (!hdr) | 3759 | if (!hdr) |
@@ -3820,6 +3816,8 @@ static int nl80211_dump_survey(struct sk_buff *skb, | |||
3820 | } | 3816 | } |
3821 | 3817 | ||
3822 | while (1) { | 3818 | while (1) { |
3819 | struct ieee80211_channel *chan; | ||
3820 | |||
3823 | res = dev->ops->dump_survey(&dev->wiphy, netdev, survey_idx, | 3821 | res = dev->ops->dump_survey(&dev->wiphy, netdev, survey_idx, |
3824 | &survey); | 3822 | &survey); |
3825 | if (res == -ENOENT) | 3823 | if (res == -ENOENT) |
@@ -3827,6 +3825,19 @@ static int nl80211_dump_survey(struct sk_buff *skb, | |||
3827 | if (res) | 3825 | if (res) |
3828 | goto out_err; | 3826 | goto out_err; |
3829 | 3827 | ||
3828 | /* Survey without a channel doesn't make sense */ | ||
3829 | if (!survey.channel) { | ||
3830 | res = -EINVAL; | ||
3831 | goto out; | ||
3832 | } | ||
3833 | |||
3834 | chan = ieee80211_get_channel(&dev->wiphy, | ||
3835 | survey.channel->center_freq); | ||
3836 | if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) { | ||
3837 | survey_idx++; | ||
3838 | continue; | ||
3839 | } | ||
3840 | |||
3830 | if (nl80211_send_survey(skb, | 3841 | if (nl80211_send_survey(skb, |
3831 | NETLINK_CB(cb->skb).pid, | 3842 | NETLINK_CB(cb->skb).pid, |
3832 | cb->nlh->nlmsg_seq, NLM_F_MULTI, | 3843 | cb->nlh->nlmsg_seq, NLM_F_MULTI, |