]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - net/wireless/scan.c
Merge branch 'for-linus' of git://neil.brown.name/md
[karo-tx-linux.git] / net / wireless / scan.c
index 4c210c2debc6773e3b84b703a3ca3b5b3fd941b2..e5f92ee758f44226999112603a4f3d59a23f222f 100644 (file)
@@ -662,7 +662,7 @@ int cfg80211_wext_siwscan(struct net_device *dev,
                                int k;
                                int wiphy_freq = wiphy->bands[band]->channels[j].center_freq;
                                for (k = 0; k < wreq->num_channels; k++) {
-                                       int wext_freq = wreq->channel_list[k].m / 100000;
+                                       int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]);
                                        if (wext_freq == wiphy_freq)
                                                goto wext_freq_found;
                                }
@@ -675,6 +675,11 @@ int cfg80211_wext_siwscan(struct net_device *dev,
                wext_freq_not_found: ;
                }
        }
+       /* No channels found? */
+       if (!i) {
+               err = -EINVAL;
+               goto out;
+       }
 
        /* Set real number of channels specified in creq->channels[] */
        creq->n_channels = i;