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 AB3783BE165; Wed, 20 May 2026 17:20:53 +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=1779297654; cv=none; b=SxfcNJCSlFJ2xfXwbaG/amtLrQ+fmFmayCVA+Cwq6WZdgFXdidZ/S2Ta7AE2h8dObN+hkMCN03lYaPFHNW6G/jRRIdVE3PG9nuMM7taNrpVa2RB1NWifbE3swt5dQ0SGAY398QXJGeRraJm5r+kXuK7ruiUecieEyLlGlIrc/vU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779297654; c=relaxed/simple; bh=rWTV6soQ7aL4pM43nn/dEOv3pSkU4L159g9qvNryLk4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rX7quIVlIwRIXCBT2YQLxIob7pGC8tgzC5zFtb/Hx6AfhntGIitu6Y0j9seFt/waqLSB4e4TjTTOWpf7U8AON3IFGhbtj6lV6RVWixccnALzqjhvQRzfA977sNcBN3QiW8QN9aLbANnKLERmC4Q8xCNMNUXc5UyOVB9rWYI5Yrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=twdKQoCS; 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="twdKQoCS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C1DF1F000E9; Wed, 20 May 2026 17:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779297653; bh=WuiQ3bZyM55afwibOEj2XjE7CW8y1T2zpLErupdI/9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=twdKQoCSs63hqY1HyI9BhVztJppkI97fVp6GnoUZdmvlmbNMfl4BXxux8MU3iALQv bLI0Ww15icnE6THfMf3V0RSjw19BotVmVh3m6Ju+txaYwjMoZ4C89k4Yd+2afLD+RK jTfDUUoa4ftBjGeClyiKUyGgqDG2cS2kh+y0LNtY= 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.18 112/957] wifi: rtw89: phy: fix uninitialized variable access in rtw89_phy_cfo_set_crystal_cap() Date: Wed, 20 May 2026 18:09:55 +0200 Message-ID: <20260520162136.989460884@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@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.18-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 ba7feadd75828..36dee482bc34b 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -4499,7 +4499,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