From patchwork Fri Sep 11 08:13:55 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Schurig X-Patchwork-Id: 46821 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8B8EVmR017500 for ; Fri, 11 Sep 2009 08:14:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752879AbZIKIOZ (ORCPT ); Fri, 11 Sep 2009 04:14:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752967AbZIKIOZ (ORCPT ); Fri, 11 Sep 2009 04:14:25 -0400 Received: from mx51.mymxserver.com ([85.199.173.110]:28734 "EHLO mx51.mymxserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752272AbZIKIOY (ORCPT ); Fri, 11 Sep 2009 04:14:24 -0400 Received: from localhost (localhost [127.0.0.1]) by localhost.mx51.mymxserver.com (Postfix) with ESMTP id EF39750006; Fri, 11 Sep 2009 10:14:26 +0200 (CEST) X-Virus-Scanned: by Mittwald Mailscanner Received: from mx51.mymxserver.com ([127.0.0.1]) by localhost (mx51.mymxserver.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VRxgjUxxw83Y; Fri, 11 Sep 2009 10:14:26 +0200 (CEST) Received: from lin01.mn-solutions.de (pD95F8345.dip0.t-ipconnect.de [217.95.131.69]) by mx51.mymxserver.com (Postfix) with ESMTP id 9990250009; Fri, 11 Sep 2009 10:14:26 +0200 (CEST) Received: by lin01.mn-solutions.de (Postfix, from userid 116) id 2C69F1E004F; Fri, 11 Sep 2009 10:14:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.1.7-deb3 (2006-10-05) on lin01.mn-logistik.de X-Spam-Level: X-Spam-Status: No, score=-4.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.7-deb3 Received: from mnz66.mn-solutions.de (mnz66.mn-solutions.de [192.168.233.66]) by lin01.mn-solutions.de (Postfix) with ESMTP id CC8191E0050; Fri, 11 Sep 2009 10:14:16 +0200 (CEST) From: Holger Schurig To: John W Linville , linux-wireless@vger.kernel.org Subject: [PATCH] cfg80211: minimal error handling for wext-compat freq scanning Date: Fri, 11 Sep 2009 10:13:55 +0200 User-Agent: KMail/1.9.7 Cc: Johannes Berg MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200909111013.55263.hs4233@mail.mn-solutions.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Signed-off-by: Holger Schurig Index: linux-wl/net/wireless/scan.c =================================================================== --- linux-wl.orig/net/wireless/scan.c 2009-09-11 09:05:39.000000000 +0200 +++ linux-wl/net/wireless/scan.c 2009-09-11 09:05:42.000000000 +0200 @@ -680,6 +680,11 @@ int cfg80211_wext_siwscan(struct net_dev err = -EINVAL; goto out; } + /* No channels found? */ + if (!i) { + err = -EINVAL; + goto out; + } /* Set real number of channels specified in creq->channels[] */ creq->n_channels = i;