From: sashiko-bot@kernel.org
To: "Guenter Roeck" <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH v6] hwmon: (ina2xx) Fix various overflow issues
Date: Sat, 25 Jul 2026 08:07:58 +0000 [thread overview]
Message-ID: <20260725080758.C932F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260725075800.346566-1-linux@roeck-us.net>
> Sashiko reports several integer overflow problems in the ina2xx driver
> caused by unbounded multiplications and inadequate types for intermediate
> calculations.
>
> Specifically:
> - In ina2xx_get_value(), the return type is changed from int to long.
> Intermediate calculations for current are now performed using 64-bit
> types to prevent 32-bit integer overflow before the division by 1000.
> - When calculating power in ina2xx_get_value() and
> sy24655_average_power_read(), interim values are cast to u64 and clamped
> to LONG_MAX. This prevents overflow when regval or accumulator_24 is
> multiplied by power_lsb_uW.
> - In ina226_alert_to_reg(), the clamping logic is rewritten using min_t().
> This safely avoids integer overflows when scaling user-provided values
> for shunt voltage, bus voltage, power, and current limits.
>
> Cc: Loic Poulain <loic.poulain@oss.qualcomm.com>
> Fixes: ab7fbee452be ("hwmon: (ina2xx) Fix various overflow issues")
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260725075800.346566-1-linux@roeck-us.net?part=1
prev parent reply other threads:[~2026-07-25 8:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 7:58 [PATCH v6] hwmon: (ina2xx) Fix various overflow issues Guenter Roeck
2026-07-25 8:07 ` sashiko-bot [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260725080758.C932F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox