From: Guenter Roeck <linux@roeck-us.net>
To: Doug Anderson <dianders@chromium.org>, Jean Delvare <jdelvare@suse.de>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH] hwmon: (ntc_thermistor): Avoid overflow
Date: Fri, 14 Feb 2014 02:51:18 +0000 [thread overview]
Message-ID: <52FD84A6.9000400@roeck-us.net> (raw)
In-Reply-To: <1392331174-12271-1-git-send-email-dianders@chromium.org>
On 02/13/2014 02:39 PM, Doug Anderson wrote:
> The ntc thermistor code was doing math whose temporary result might
> have overflowed 32-bits. We need some casts in there to make it safe.
>
> In one example I found:
> - pullup_uV: 1800000
> - result of iio_read_channel_raw: 3226
> - 1800000 * 3226 => 0x15a1cbc80
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
Nice catch. Applied.
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
WARNING: multiple messages have this Message-ID (diff)
From: Guenter Roeck <linux@roeck-us.net>
To: Doug Anderson <dianders@chromium.org>, Jean Delvare <jdelvare@suse.de>
Cc: lm-sensors@lm-sensors.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hwmon: (ntc_thermistor): Avoid overflow
Date: Thu, 13 Feb 2014 18:51:18 -0800 [thread overview]
Message-ID: <52FD84A6.9000400@roeck-us.net> (raw)
In-Reply-To: <1392331174-12271-1-git-send-email-dianders@chromium.org>
On 02/13/2014 02:39 PM, Doug Anderson wrote:
> The ntc thermistor code was doing math whose temporary result might
> have overflowed 32-bits. We need some casts in there to make it safe.
>
> In one example I found:
> - pullup_uV: 1800000
> - result of iio_read_channel_raw: 3226
> - 1800000 * 3226 => 0x15a1cbc80
>
> Signed-off-by: Doug Anderson <dianders@chromium.org>
Nice catch. Applied.
Thanks,
Guenter
next prev parent reply other threads:[~2014-02-14 2:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 22:39 [lm-sensors] [PATCH] hwmon: (ntc_thermistor): Avoid overflow Doug Anderson
2014-02-13 22:39 ` Doug Anderson
2014-02-14 2:51 ` Guenter Roeck [this message]
2014-02-14 2:51 ` 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=52FD84A6.9000400@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dianders@chromium.org \
--cc=jdelvare@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.