From patchwork Thu Aug 28 07:59:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 4797531 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 7211D9F375 for ; Thu, 28 Aug 2014 08:10:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9227B2012E for ; Thu, 28 Aug 2014 08:10:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74D4B20145 for ; Thu, 28 Aug 2014 08:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965606AbaH1IJo (ORCPT ); Thu, 28 Aug 2014 04:09:44 -0400 Received: from mail-lb0-f181.google.com ([209.85.217.181]:44333 "EHLO mail-lb0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965592AbaH1IJ2 (ORCPT ); Thu, 28 Aug 2014 04:09:28 -0400 Received: by mail-lb0-f181.google.com with SMTP id n15so452313lbi.26 for ; Thu, 28 Aug 2014 01:09:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=X9Xikpd8jvWg7xmm9Rj9BdAghVqng1gkWgUqkcvwvm8=; b=QuV7tw1O4XwM/XXZUUqKaGw1acrdNjYXrLL72447hPKvwwO7ZPMA2YwX57oHnE/viS lI8Nmu/PFhunf+irJtivKOeMdHJPGLIKRYBblfLTayQZQvq6A1Cz6+BApwdxX0/Ney/U IAfN13ZYzK5DIC5SKeFhQ53bj81BM0dN/TdZY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X9Xikpd8jvWg7xmm9Rj9BdAghVqng1gkWgUqkcvwvm8=; b=JQdMTsEpTyBB/qRTBdpe4iFbXM+Q+pDkUOELqsHWsAtlHhGmlRjYYpOh9bQov0uDLg 35VEBmQwvBQV4h0dNirFjAjv5fXRJEZ6up5x0OHg9yOXAnNi071L/3wuKdb1wJ3T290P pLQM+DxbdDd9F1hbj6mB5Bl69cJ346ECRmeVhYQWxdtn/gccfxFl4DWSHEgk8hj1dgin VgdFoIx02wNMyNt+TozlIcY4p0YH44Vh6LgoA3RNtg1DLwFH62aa5tl23pcstPJTXI+9 FPyhs9T5B5piRd4/qK4q7ZupVphywxwqd8DFgaYr/un5uyRBoe2MN8Ymcd50DxyOHODY Ew6A== X-Gm-Message-State: ALoCoQnz08mcMCCDsDBZVcCb2EQLh2D/fwlWiTUCML/ToP2WL67dvfnCy7VR8BecAEBwgDOHDLkY9g2uTmTf0SawohU7gJcGUBuOHx0wBtvv46TjZvH2VO6JEBmiGmn7Saasqo6URb+0 X-Received: by 10.112.209.36 with SMTP id mj4mr2424703lbc.26.1409213366945; Thu, 28 Aug 2014 01:09:26 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id rl10sm1849470lac.28.2014.08.28.01.09.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Aug 2014 01:09:26 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH] ath10k: fix num_legacy_stations tracking Date: Thu, 28 Aug 2014 09:59:39 +0200 Message-Id: <1409212779-5212-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 If a station was reassociated, i.e. due to change of supported rates update via sta_rc_update() the num_legacy_stations would be (incorrectly) bumped up leading to unbalanced usage of the var. This in turn could lock rtscts protection up as enabled. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index b858c82..4e30e57 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1615,7 +1615,7 @@ static int ath10k_station_assoc(struct ath10k *ar, struct ath10k_vif *arvif, return ret; } - if (!sta->wme) { + if (!sta->wme && !reassoc) { arvif->num_legacy_stations++; ret = ath10k_recalc_rtscts_prot(arvif); if (ret) {