[PATCH linux dev-6.6] hwmon: (pt5161l) Fix invalid temperature reading
Andrew Jeffery
andrew at codeconstruct.com.au
Thu Sep 12 13:29:17 AEST 2024
On Thu, 2024-08-29 at 16:41 +0800, Cosmo Chou wrote:
> 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: 1b2ca93cd059 ("hwmon: Add driver for Astera Labs PT5161L retimer")
> Signed-off-by: Cosmo Chou <chou.cosmo at gmail.com>
> ---
> Link: https://lore.kernel.org/all/c16f3254-36c1-4ec3-ac09-ca15ed547413@roeck-us.net/
Thanks, I've backported the change from upstream directly.
Andrew
More information about the openbmc
mailing list