Skip to content
Commit 1e9f22cd authored by Cosmo Chou's avatar Cosmo Chou Committed by Greg Kroah-Hartman
Browse files

hwmon: (pt5161l) Fix invalid temperature reading



[ Upstream commit 7bbc079531fc38d401e1c4088d4981435a8828e3 ]

The temperature reading function was using a signed long for the ADC
code, which could lead to mishandling of invalid codes on 32-bit
platforms. This allowed out-of-range ADC codes to be incorrectly
interpreted as valid values and used in temperature calculations.

Change adc_code to u32 to ensure that invalid ADC codes are correctly
identified on all platforms.

Fixes: 1b2ca93c ("hwmon: Add driver for Astera Labs PT5161L retimer")
Signed-off-by: default avatarCosmo Chou <chou.cosmo@gmail.com>
Message-ID: <20240819104630.2375441-1-chou.cosmo@gmail.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 1d6d9b5b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment