[PATCH 0/2] hwmon: (ltc2992) Fix threshold write and power read overflow

From: Pradhan, Sanman

Date: Thu Apr 16 2026 - 18:00:30 EST


From: Sanman Pradhan <psanman@xxxxxxxxxxx>

The ltc2992 driver has two related bugs in its threshold/power
handling paths.

Patch 1 clamps threshold writes (voltage, current, power) to the
hardware-representable range, preventing negative values from wrapping,
intermediate arithmetic from overflowing u64 on 64-bit, and register
values from exceeding the hardware field width. In the power write
path, a factor-of-1000 cancellation also eliminates a u32 overflow in
the divisor computation.

Patch 2 applies the same factor-of-1000 cancellation to the power read
path, which has the identical u32 overflow in its divisor.

Sanman Pradhan (2):
hwmon: (ltc2992) Clamp threshold writes to hardware range
hwmon: (ltc2992) Fix u32 overflow in power read path

drivers/hwmon/ltc2992.c | 43 +++++++++++++++++++++++++++++++----------
1 file changed, 33 insertions(+), 10 deletions(-)

--
2.34.1