From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79359C48BD9 for ; Thu, 27 Jun 2019 00:34:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4665620659 for ; Thu, 27 Jun 2019 00:34:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561595651; bh=CqGM+weWgCPGBuGa69EzqSAFp37GL7myimy/h9Olkws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=aSDvNQjG8bL3AmT7pjD2YbwhC12gHfQxgZS+IYUd2y3wqvMLYH71WCdUe1kewOiyE nN+nL0ZVjaZtMyW+Z/GxJJShb7FclKzDC86y2l2Nsz6LNJIQFWKIfhwjjxNLkJgYdN NJuBCiXgqVxWEm7Inn4O2AwAWGq5JvcGsQWN0mvQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbfF0AeK (ORCPT ); Wed, 26 Jun 2019 20:34:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:38210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727954AbfF0AeI (ORCPT ); Wed, 26 Jun 2019 20:34:08 -0400 Received: from sasha-vm.mshome.net (unknown [107.242.116.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5766121738; Thu, 27 Jun 2019 00:34:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561595647; bh=CqGM+weWgCPGBuGa69EzqSAFp37GL7myimy/h9Olkws=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ryVqoQBpTpT8PYBHtoaqPCw/VGhl+DxLJPhdkhwDCJ6ZEn/GqK6iveWsR83HjA2QW HaEGbTQ6HELwPdJ3Y/jZWzHxvpEuo+F1LAnMsACCe0Shx6YAi8XqUUxQ78I9TMvOdk oeWPzf2+MlEqgMSJINa/KWoD0wWpVYgzvU2XQ/YU= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mordechay Goodstein , Luca Coelho , Johannes Berg , Sasha Levin , linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 5.1 66/95] cfg80211: util: fix bit count off by one Date: Wed, 26 Jun 2019 20:29:51 -0400 Message-Id: <20190627003021.19867-66-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190627003021.19867-1-sashal@kernel.org> References: <20190627003021.19867-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Mordechay Goodstein [ Upstream commit 1a473d6092d5d182914bea854ce0b21e6d12519d ] The bits of Rx MCS Map in VHT capability were enumerated with index transform - index i -> (i + 1) bit => nss i. BUG! while it should be - index i -> (i + 1) bit => (i + 1) nss. The bug was exposed in commit a53b2a0b1245 ("iwlwifi: mvm: implement VHT extended NSS support in rs.c"), where iwlwifi started using the function. Signed-off-by: Mordechay Goodstein Fixes: b0aa75f0b1b2 ("ieee80211: add new VHT capability fields/parsing") Signed-off-by: Luca Coelho Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/wireless/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/wireless/util.c b/net/wireless/util.c index 5a03f38788e7..5ac66a571e33 100644 --- a/net/wireless/util.c +++ b/net/wireless/util.c @@ -1989,7 +1989,7 @@ int ieee80211_get_vht_max_nss(struct ieee80211_vht_cap *cap, continue; if (supp >= mcs_encoding) { - max_vht_nss = i; + max_vht_nss = i + 1; break; } } -- 2.20.1