Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: (max6697) Fix underflow when writing limit attributes
Date: Sun, 14 Jul 2024 15:07:01 +0800	[thread overview]
Message-ID: <ZpN5FSnlNFm6wW2Y@tzungbi-laptop> (raw)
In-Reply-To: <20240713213402.1085599-2-linux@roeck-us.net>

On Sat, Jul 13, 2024 at 02:34:02PM -0700, Guenter Roeck wrote:
> Using DIV_ROUND_CLOSEST() on an unbound value can result in underflows.
> Indeed, module test scripts report:
> 
> temp1_max: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
> temp1_crit: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
> 
> Fix by introducing an extra set of clamping.
> 
> Fixes: 5372d2d71c46 ("hwmon: Driver for Maxim MAX6697 and compatibles")
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>

  reply	other threads:[~2024-07-14  7:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-13 21:34 [PATCH 1/2] hwmon: (max6697) Fix swapped temp{1,8} critical alarms Guenter Roeck
2024-07-13 21:34 ` [PATCH 2/2] hwmon: (max6697) Fix underflow when writing limit attributes Guenter Roeck
2024-07-14  7:07   ` Tzung-Bi Shih [this message]
2024-07-14  7:06 ` [PATCH 1/2] hwmon: (max6697) Fix swapped temp{1,8} critical alarms Tzung-Bi Shih
2024-07-14 18:47   ` Guenter Roeck

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=ZpN5FSnlNFm6wW2Y@tzungbi-laptop \
    --to=tzungbi@kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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