diff options
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r-- | net/wireless/scan.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 4c210c2debc6..e5f92ee758f4 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -662,7 +662,7 @@ int cfg80211_wext_siwscan(struct net_device *dev, | |||
662 | int k; | 662 | int k; |
663 | int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; | 663 | int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; |
664 | for (k = 0; k < wreq->num_channels; k++) { | 664 | for (k = 0; k < wreq->num_channels; k++) { |
665 | int wext_freq = wreq->channel_list[k].m / 100000; | 665 | int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]); |
666 | if (wext_freq == wiphy_freq) | 666 | if (wext_freq == wiphy_freq) |
667 | goto wext_freq_found; | 667 | goto wext_freq_found; |
668 | } | 668 | } |
@@ -675,6 +675,11 @@ int cfg80211_wext_siwscan(struct net_device *dev, | |||
675 | wext_freq_not_found: ; | 675 | wext_freq_not_found: ; |
676 | } | 676 | } |
677 | } | 677 | } |
678 | /* No channels found? */ | ||
679 | if (!i) { | ||
680 | err = -EINVAL; | ||
681 | goto out; | ||
682 | } | ||
678 | 683 | ||
679 | /* Set real number of channels specified in creq->channels[] */ | 684 | /* Set real number of channels specified in creq->channels[] */ |
680 | creq->n_channels = i; | 685 | creq->n_channels = i; |