From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 446C530DEAC; Wed, 20 May 2026 18:30:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301841; cv=none; b=Z81eV7G+zfHLMr62maVPJwPzHmOpK6IRsHQGfh+OMGjmGr5BtcKIrtzGuuOCOq8qWVE9jmrqhYpEtGQUQIlXAg0VVz+V8J918HUZnXusA8MZ7U4+I8ps4Jnls5E+hWNSAs/QRjwf4+lvkjcqPev+u5GTvioURRgQkv3dkv3/5uU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301841; c=relaxed/simple; bh=j5Ez2AFBuRIDxLWqNv8qblo0kZLTfjnF+SgQltA2fU0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bUsg3K1lxb362sANuzbvlHmgQVY14ZLO5PeTWmeb+QOwsn55Bmtq5yvXpVm43HRz3VBLSZh8mVXwFio+6Zl7467f5l5Ry+ZBejg8rxe70AHAsAVKdUuwxp46BKwD8+kqqqjEWivSAmEdMM94LrUQPGtrAT5jkOxDkrwCA1+xpPw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1NknO5eo; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="1NknO5eo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A15391F000E9; Wed, 20 May 2026 18:30:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779301840; bh=iINCJKi3IYtWBEPW609DWcpMpoqbO7r6Frwz16XVOhw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=1NknO5eo39EJ6xbRT62iXvAm/4fymlWM3kCfw8L0tOukQleJGCBvt3P0XPJT1BULi Oka+QthidijsIIygTvsOx03T4vmpXPBYZpSVa22egDzZnF3EMr42jX9o2/XQjAhVK2 kLu4lwF3mZQRgql52HR/fZM3eZ+yG0gxdNbgmbTA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alexey Velichayshiy , Ping-Ke Shih , Sasha Levin Subject: [PATCH 6.6 041/508] wifi: rtw89: phy: fix uninitialized variable access in rtw89_phy_cfo_set_crystal_cap() Date: Wed, 20 May 2026 18:17:44 +0200 Message-ID: <20260520162059.483291436@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162058.573354582@linuxfoundation.org> References: <20260520162058.573354582@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alexey Velichayshiy [ Upstream commit 047cddf88c611e616d49a00311d4722e46286234 ] In the rtw89_phy_cfo_set_crystal_cap() function, for chips other than RTL8852A/RTL8851B, the values read by rtw89_mac_read_xtal_si() are stored into the local variables sc_xi_val and sc_xo_val. If either read fails, these variables remain uninitialized, they are later used to update cfo->crystal_cap and in debug print statements. This can lead to undefined behavior. Fix the issue by initializing sc_xi_val and sc_xo_val to zero, like is implemented in vendor driver. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 8379fa611536 ("rtw89: 8852c: add write/read crystal function in CFO tracking") Signed-off-by: Alexey Velichayshiy Acked-by: Ping-Ke Shih Signed-off-by: Ping-Ke Shih Link: https://patch.msgid.link/20260323140613.1615574-1-a.velichayshiy@ispras.ru Signed-off-by: Sasha Levin --- drivers/net/wireless/realtek/rtw89/phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/phy.c b/drivers/net/wireless/realtek/rtw89/phy.c index 457c1dd31bf9d..3da2f623c01c6 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -2434,7 +2434,7 @@ static void rtw89_phy_cfo_set_crystal_cap(struct rtw89_dev *rtwdev, { struct rtw89_cfo_tracking_info *cfo = &rtwdev->cfo_tracking; const struct rtw89_chip_info *chip = rtwdev->chip; - u8 sc_xi_val, sc_xo_val; + u8 sc_xi_val = 0, sc_xo_val = 0; if (!force && cfo->crystal_cap == crystal_cap) return; -- 2.53.0