aboutsummaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/scan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 6c20b6515ab..e5f92ee758f 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -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;