cfg80211: minimal error handling for wext-compat freq scanning
authorHolger Schurig <hs4233@mail.mn-solutions.de>
Fri, 11 Sep 2009 08:13:55 +0000 (10:13 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 14 Sep 2009 18:36:04 +0000 (14:36 -0400)
Signed-off-by: Holger Schurig <hs4233@mail.mn-solutions.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
net/wireless/scan.c

index 6c20b6515ab08ad694a2efea0fe76e3b4aeea6dd..e5f92ee758f44226999112603a4f3d59a23f222f 100644 (file)
@@ -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;