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

Pradhan, Sanman posted 2 patches 2 months ago
drivers/hwmon/ltc2992.c | 43 +++++++++++++++++++++++++++++++----------
1 file changed, 33 insertions(+), 10 deletions(-)
[PATCH 0/2] hwmon: (ltc2992) Fix threshold write and power read overflow
Posted by Pradhan, Sanman 2 months ago
From: Sanman Pradhan <psanman@juniper.net>

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

Re: [PATCH 0/2] hwmon: (ltc2992) Fix threshold write and power read overflow
Posted by Pradhan, Sanman 1 month, 2 weeks ago
From: Sanman Pradhan <psanman@juniper.net>

Hi Guenter,

Friendly ping on this series. Please let me know if you have any
feedback or if there's anything I should rework.

Sashiko AI has already reviewed the patchset:
https://sashiko.dev/#/patchset/20260416215904.101969-1-sanman.pradhan%40hpe.com

Thank you.

Regards,
Sanman Pradhan