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 6093F3C3458; Wed, 20 May 2026 16:31:35 +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=1779294696; cv=none; b=FDwZ67Cf7Oc+jPcERM8gC600bZHXr+CfwJeap3KDOFRxtJE45qZODDXMSMGYba8lyLDg6Hu4odZKMR9N1NZ6tEi57Kadvm5CiQo7BcKmFOZI06yDWGROs59guPy6OUyKCgywHkQi0CB3ml9GE/KgQ6r1DXlfMJxXkSjOFwuwAoo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779294696; c=relaxed/simple; bh=DK0IlJoTvGfgycoXf8NQ48p/zaT9nFJ0okpf+JApnz4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QbQhGr2wn3V6eKKT+GbTPN30by85aCN+1jxaKR66lkaQe/2ur2gUbCIawEyjYL+RFnRjb77FtKRWepeGabymXKXsEdCVoUtd8MhA31cOXkC2O5gtT0LjQyyH1Q97MerE1AbTwr8uLhs+9B931nAkTI5KhRXwteHYu1v3FdhhGI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=WqAj887i; 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="WqAj887i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C59F41F000E9; Wed, 20 May 2026 16:31:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779294695; bh=yolM2qp7mZZsM6feCcudGihGxpHjbhc16SPdO7RhJdQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=WqAj887imqx5ItKHGTwGskJTrW6PvWTzKRd0uLjUUVssHsZMQkD7pCZqMDLHkstBf TB93dcyYaErfhJJvUsR4hvliXV6Ii8GReo3tXwyyePvrrtmlgL7PhO5HfzAiRCWe5E zcRK7bbqF4ugp8JQOh9DXSHs3tj/qXiBGYqN0/zY= 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 7.0 0138/1146] wifi: rtw89: phy: fix uninitialized variable access in rtw89_phy_cfo_set_crystal_cap() Date: Wed, 20 May 2026 18:06:28 +0200 Message-ID: <20260520162151.440322526@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@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 7.0-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 ee6ab2136b9a7..ee8a36003e5da 100644 --- a/drivers/net/wireless/realtek/rtw89/phy.c +++ b/drivers/net/wireless/realtek/rtw89/phy.c @@ -4860,7 +4860,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