From patchwork Fri Mar 27 08:21:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 6104151 X-Patchwork-Delegate: kvalo@adurom.com 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 580A89F350 for ; Fri, 27 Mar 2015 08:24:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7EC05203F7 for ; Fri, 27 Mar 2015 08:24:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C5938203B8 for ; Fri, 27 Mar 2015 08:24:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015AbbC0IYp (ORCPT ); Fri, 27 Mar 2015 04:24:45 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:36738 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751698AbbC0IYn (ORCPT ); Fri, 27 Mar 2015 04:24:43 -0400 Received: by labe2 with SMTP id e2so64610476lab.3 for ; Fri, 27 Mar 2015 01:24:42 -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=C3uFkJ2Wj9Zr8LyNN/LUXmCjj8QGsWoMIpYwk/OcEMw=; b=TXTf8FNgGteRYSYK2QQagSWdwrI0WlZyoqp43HlphYBUtkbHQVPEq625os1xCniMjw HfOI5mei08DrY+n+dR4vF+5Fj33Jjoc0IRaxLJung3M07+uUPyAo2vBOnAqGq/Yvq8BD dxKMhxBXc1YEYqsX8nXo9QN8JY4KYD4ePOsKg= 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=C3uFkJ2Wj9Zr8LyNN/LUXmCjj8QGsWoMIpYwk/OcEMw=; b=Tga9n4/JePVXm2oCyCEbkZO0mbu898YDFvTG7Kcup1S5V7z6GXO6bweC2jF7TtwJU4 OvVCDKT0qCr0/MNTKG8b/c340dIv6Ue8sXUTdmYlxfsnw6d4p3GnRHSpbSsFIMtgFFUf E/m2/ByzK5gSvaF6tZC+Ese3BSsMA5CIXlFl/xD5PvtZcMAM/YlTB+F/FDBt3iVMMvl1 EAzXu/PMw3X5luzWPp7GKUvpt57w/ie0FX3AZNicb/ZlRbffu75IrS3aB/iRaH6txfek NITMvXdZBVTxDXQrKtpVt7qPMyT3ElKStFtrt0bZQ6h8Yhv+HKhvGf17H6OhHNJlvMI6 OGxg== X-Gm-Message-State: ALoCoQnZhbVFE1Bn2UHCMapxCrY9y+PSlMqT9lEtQo8rkKl+Pto/0nCWSANfuKjCz+vaXgtpsYPFrIORqLKxqxSr8lpmtw2HlrsgGESWqy0ziTPPTpG8weHTuRNlPVG6lpZoSrPlgnIw X-Received: by 10.112.64.2 with SMTP id k2mr17155839lbs.54.1427444681900; Fri, 27 Mar 2015 01:24:41 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id iy9sm218725lbc.8.2015.03.27.01.24.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Mar 2015 01:24:40 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 1/2] ath10k: fix arvif->wep_keys clearing Date: Fri, 27 Mar 2015 08:21:55 +0000 Message-Id: <1427444516-974-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 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,T_DKIM_INVALID,T_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 The variable should be cleared regardless of whether there's a peer associated with the key or not. This fixes case when user first associates with 2 WEP keys and then disconnects and connects with 1 WEP key. This resulted in WEP key count being 2 in the driver leading to default keyidx fixup failure. Signed-off-by: Michal Kazior Tested-by: Bartosz Markowski --- drivers/net/wireless/ath/ath10k/mac.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9b8313dcb888..9d873900257d 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4101,6 +4101,13 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, key->hw_key_idx = key->keyidx; + if (is_wep) { + if (cmd == SET_KEY) + arvif->wep_keys[key->keyidx] = key; + else + arvif->wep_keys[key->keyidx] = NULL; + } + /* the peer should not disappear in mid-way (unless FW goes awry) since * we already hold conf_mutex. we just make sure its there now. */ spin_lock_bh(&ar->data_lock); @@ -4126,11 +4133,6 @@ static int ath10k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, flags |= WMI_KEY_GROUP; if (is_wep) { - if (cmd == SET_KEY) - arvif->wep_keys[key->keyidx] = key; - else - arvif->wep_keys[key->keyidx] = NULL; - if (cmd == DISABLE_KEY) ath10k_clear_vdev_key(arvif, key);