From patchwork Thu Sep 26 15:55:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruno Randolf X-Patchwork-Id: 2949471 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D76089F288 for ; Thu, 26 Sep 2013 16:03:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD73B201F5 for ; Thu, 26 Sep 2013 16:03:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1D6E42031A for ; Thu, 26 Sep 2013 16:03:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753436Ab3IZQDr (ORCPT ); Thu, 26 Sep 2013 12:03:47 -0400 Received: from postler.einfach.org ([91.250.116.113]:37639 "EHLO postler.einfach.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753377Ab3IZQDd (ORCPT ); Thu, 26 Sep 2013 12:03:33 -0400 X-Greylist: delayed 462 seconds by postgrey-1.27 at vger.kernel.org; Thu, 26 Sep 2013 12:03:32 EDT Received: from localhost (localhost [127.0.0.1]) by postler.einfach.org (Postfix) with ESMTP id 497A616B48570; Thu, 26 Sep 2013 17:55:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at postler.einfach.org Received: from postler.einfach.org ([127.0.0.1]) by localhost (test.softworks.at [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CqHz4d8mZMZo; Thu, 26 Sep 2013 17:55:41 +0200 (CEST) Received: from localhost.localdomain (unknown [77.227.227.225]) by postler.einfach.org (Postfix) with ESMTPA id 0EDBF16B4856D; Thu, 26 Sep 2013 17:55:40 +0200 (CEST) From: Bruno Randolf To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com, johannes@sipsolutions.net, Bruno Randolf Subject: [PATCH] cfg80211: fix warning when using WEXT for IBSS Date: Thu, 26 Sep 2013 16:55:28 +0100 Message-Id: <1380210928-6604-1-git-send-email-br1@einfach.org> X-Mailer: git-send-email 1.8.1.2 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fix kernel warning when using WEXT for configuring ad-hoc mode, e.g. "iwconfig wlan0 essid test channel 1" [ 1003.460000] WARNING: at net/wireless/chan.c:373 cfg80211_chandef_usable+0x50/0x21c [cfg80211]() The warning is caused by an uninitialized variable center_freq1. Signed-off-by: Bruno Randolf --- net/wireless/ibss.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 39bff7d..a096e2c 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c @@ -263,6 +263,7 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, if (chan->flags & IEEE80211_CHAN_DISABLED) continue; wdev->wext.ibss.chandef.chan = chan; + wdev->wext.ibss.chandef.center_freq1 = chan->center_freq; break; } @@ -347,6 +348,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, if (chan) { wdev->wext.ibss.chandef.chan = chan; wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; + wdev->wext.ibss.chandef.center_freq1 = freq; wdev->wext.ibss.channel_fixed = true; } else { /* cfg80211_ibss_wext_join will pick one if needed */