From patchwork Tue Feb 11 11:45:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 3626501 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C80DABF418 for ; Tue, 11 Feb 2014 11:47:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1569C201EF for ; Tue, 11 Feb 2014 11:47:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EFD97201ED for ; Tue, 11 Feb 2014 11:47:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751487AbaBKLrf (ORCPT ); Tue, 11 Feb 2014 06:47:35 -0500 Received: from mga02.intel.com ([134.134.136.20]:4208 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751218AbaBKLre (ORCPT ); Tue, 11 Feb 2014 06:47:34 -0500 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 11 Feb 2014 03:47:34 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.95,825,1384329600"; d="scan'208";a="481520749" Received: from egrumbaclab.jer.intel.com ([10.12.217.137]) by orsmga002.jf.intel.com with ESMTP; 11 Feb 2014 03:47:32 -0800 From: Emmanuel Grumbach To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, David Spinadel Subject: [PATCH] mac80211: fix IE buffer len Date: Tue, 11 Feb 2014 13:45:41 +0200 Message-Id: <1392119141-27279-1-git-send-email-emmanuel.grumbach@intel.com> X-Mailer: git-send-email 1.8.3.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=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: David Spinadel Remove size of SSID IE from the IE buffer in scan and sched scan, since this IE isn't added to this buffer. Change-Id: Ic381cd50566529907c3a37f6aaa02d9132fd99da Signed-off-by: David Spinadel Reviewed-on: https://gerrit.rds.intel.com/30710 Tested-by: IWL Jenkins Reviewed-by: EliadX Peller Reviewed-by: Emmanuel Grumbach Reviewed-by: Alexander Bondar Reviewed-by: Johannes Berg --- net/mac80211/scan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 88c8161..b211e41 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -472,9 +472,7 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata, if (local->ops->hw_scan) { u8 *ies; - local->hw_scan_ies_bufsize = 2 + IEEE80211_MAX_SSID_LEN + - local->scan_ies_len + - req->ie_len; + local->hw_scan_ies_bufsize = local->scan_ies_len + req->ie_len; local->hw_scan_req = kmalloc( sizeof(*local->hw_scan_req) + req->n_channels * sizeof(req->channels[0]) + @@ -979,8 +977,7 @@ int __ieee80211_request_sched_scan_start(struct ieee80211_sub_if_data *sdata, struct cfg80211_chan_def chandef; int ret, i, iebufsz; - iebufsz = 2 + IEEE80211_MAX_SSID_LEN + - local->scan_ies_len + req->ie_len; + iebufsz = local->scan_ies_len + req->ie_len; lockdep_assert_held(&local->mtx);