Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2483702lqp; Sun, 24 Mar 2024 22:57:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWz18sx9/b+waY+WYFWDFcpyZFT4M8PNHG5QjDRQ1kxaD13d48046tW/E7tetqYLwlSxSnPCinMlpdDUj7YmM8A/GNqiNScqt/cZrQOSw== X-Google-Smtp-Source: AGHT+IG4m54PMZBaKRCpYqi9s2n6tKU+ysFrXVN32Y2gWzgNO3Dg0a3ijuQApAHE3dQbTbHaDaV/ X-Received: by 2002:a17:906:a052:b0:a47:36e9:d45 with SMTP id bg18-20020a170906a05200b00a4736e90d45mr3883959ejb.0.1711346264183; Sun, 24 Mar 2024 22:57:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711346264; cv=pass; d=google.com; s=arc-20160816; b=KLx30JNG0CEutqMNIX8PcpNZiejbqBdGbH/hvrfY5XdI6Fq7PjPONpVT9rVu/BbhoM o+AFg+qVmywluEzM+ThqQTBgr6YUy69VzVaMVU8qcBve/S++H77ebL9qWzZUw4i9r7c6 JZiOTaIwRReOGdJJMmj3BZNLlnrav2AtyFi9MyvTpkbb3G5dIhCnSw5RoVb0HYccay5e k0h3hwziKbKold7sYjT7M3v5cSc77KkFxgKZXpgM3kmdyLcdQcHSO6JmEx9bbg2kMTE9 jdLG+JSPD9z77uk1clok9TqhR88gJQAyTo16zJwfkAHhN84fX30ETOn7ZfAzt479nEfh yMRQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=9kXB/yiET0IlrwUkr4PLavxzog6F9MDsd7XNvrBV/1I=; fh=Owg512tcq8WZ0AY0x31IAaCZPSGdm3e3SsopvMcxpJQ=; b=XbLbgKHZx0byERHH80OHgKynowBFImn6BpQbtoc0oYsUFc+jV2TLjifsm5Liti0/x6 y1rSrpe52tLDux9IzZQJ3mcVTnJi0yEG5Bwuo4jM+kmQKDGMv4rqkSDCoeSu3k6lK6rB Uf7q8ev/y0YXbaOY7mDOcsC37D81HYDpAZfn8/1ifOaBIuVOSMk43HoCVHfARwGSezKK 6HaxV5LgNBuzWWbRECRyO1iaYgVhdCpvMx8XvOMog6DWHxIOt/Ys3QI7ynoIfAN1u3x4 sOH/URw1LFl1uYlCDJWpcYvGv/y3wiYzzjbKR+n8zT9oUXH9tn6zKTatpVABGUfh/H+r HfzQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=siSNM6HH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gl17-20020a170906e0d100b00a46bb779746si2231813ejb.298.2024.03.24.22.57.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 22:57:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=siSNM6HH; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-113682-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113682-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id C67E31F2F223 for ; Mon, 25 Mar 2024 05:13:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 304F21E0E4A; Sun, 24 Mar 2024 22:52:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="siSNM6HH" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F3A1E1D8BC5; Sun, 24 Mar 2024 22:50:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320645; cv=none; b=seFJyvjwDJNHxDV2gRndf0QkDzhxxjZUTyPNHFZFHaCM9bIqFBvYYwRtCn984scA8oVO71puMIUsxyPzikP0bXkymeE+g1jIYbUBDIS9EO7unizQGFVX6LToPhxxj7hDCVapkvmai7w83HWNFAJOddfSbZmDiaCG/CThNw1MUAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320645; c=relaxed/simple; bh=IjhCCsBYDRk59ErJJBfFAuXUot+zVTutag8G8d+U7us=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FREFJmCZgkedqTSfiEIgLfWjkXLIsfd/+LsgGvdkKTP4+m9Op6+RGLWY+7fs9zel5+s4T0D4cbigT19rvAsexlqgt2LwZ4/FIaCHEQf+wc6YYn6uUaWbKFPORh7G9oMG5Lisy+qpVnTYwYHrgKhQrGC96Lj9S+nxDAEZAA77MSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=siSNM6HH; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11B76C43394; Sun, 24 Mar 2024 22:50:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320643; bh=IjhCCsBYDRk59ErJJBfFAuXUot+zVTutag8G8d+U7us=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=siSNM6HH7GfMEnlGZoDqs5bdqH0Bp03UObkIHxQrkrmPxzgQbFhF7grLmsUTUjYqD mAb1nrbBwnMf+Evy1kCOuxU8T+hQPLUTN8qwi1MxVbapIHp6nc1yjhid3kV3qsh5XB N74n+NaguSQzFkdUWotCcIQrypyPyfgwG03Dkwg1QLqu7cxljtaKjrGwxWEZenmlZi DSCwMuH2taZPhGitSIS4EBGVW6QGXbh3krCanvusn3yRahaQrfCZn5BkCbRfIEc1h2 Dhs5fYbxS6Ehc2w+C/a8ZrR68VZNN6OW0UTrDhkur1Vykp66/3GjSdrmQmvE4/JkXl hz6fOpA/r4GIQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Baochen Qiang , kernel test robot , Jeff Johnson , Kalle Valo , Sasha Levin Subject: [PATCH 6.7 205/713] wifi: ath11k: initialize rx_mcs_80 and rx_mcs_160 before use Date: Sun, 24 Mar 2024 18:38:51 -0400 Message-ID: <20240324224720.1345309-206-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324224720.1345309-1-sashal@kernel.org> References: <20240324224720.1345309-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Baochen Qiang [ Upstream commit b802e7b7e771dee3377d071418281f8b64d2d832 ] Currently in ath11k_peer_assoc_h_he() rx_mcs_80 and rx_mcs_160 are used to calculate max_nss, see if (support_160) max_nss = min(rx_mcs_80, rx_mcs_160); else max_nss = rx_mcs_80; Kernel test robot complains on uninitialized symbols: drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'. drivers/net/wireless/ath/ath11k/mac.c:2321 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_160'. drivers/net/wireless/ath/ath11k/mac.c:2323 ath11k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'. This is because there are some code paths that never set them, so the assignment of max_nss can come from uninitialized variables. This could result in some unknown issues since a wrong peer_nss might be passed to firmware. Change to initialize them to an invalid value at the beginning. This makes sense because even max_nss gets an invalid value, due to either or both of them being invalid, we can get an valid peer_nss with following guard: arg->peer_nss = min(sta->deflink.rx_nss, max_nss) Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 Fixes: 3db26ecf7114 ("ath11k: calculate the correct NSS of peer for HE capabilities") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202401311243.NyXwWZxP-lkp@intel.com/ Signed-off-by: Baochen Qiang Acked-by: Jeff Johnson Signed-off-by: Kalle Valo Link: https://msgid.link/20240202023547.11141-1-quic_bqiang@quicinc.com Signed-off-by: Sasha Levin --- drivers/net/wireless/ath/ath11k/mac.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/mac.c b/drivers/net/wireless/ath/ath11k/mac.c index e09b21a82c20f..1c4613b1bd225 100644 --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c @@ -2297,6 +2297,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, mcs_160_map = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160); mcs_80_map = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_80); + /* Initialize rx_mcs_160 to 9 which is an invalid value */ + rx_mcs_160 = 9; if (support_160) { for (i = 7; i >= 0; i--) { u8 mcs_160 = (mcs_160_map >> (2 * i)) & 3; @@ -2308,6 +2310,8 @@ static void ath11k_peer_assoc_h_he(struct ath11k *ar, } } + /* Initialize rx_mcs_80 to 9 which is an invalid value */ + rx_mcs_80 = 9; for (i = 7; i >= 0; i--) { u8 mcs_80 = (mcs_80_map >> (2 * i)) & 3; -- 2.43.0