linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Jonathan Cameron <jic23@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency
Date: Tue, 6 Apr 2021 05:13:38 -0500	[thread overview]
Message-ID: <ec7abed3-1685-8ae0-1a89-d9fc4ee76275@embeddedor.com> (raw)
In-Reply-To: <20210405172646.6a9f1b7d@jic23-huawei>



On 4/5/21 11:26, Jonathan Cameron wrote:
> On Mon, 29 Mar 2021 15:58:17 -0500
> "Gustavo A. R. Silva" <gustavoars@kernel.org> wrote:
> 
>> Add suffix ULL to constant 1000 in order to avoid a potential integer
>> overflow and give the compiler complete information about the proper
>> arithmetic to use. Notice that this constant is being used in a context
>> that expects an expression of type unsigned long long, but it's
>> currently evaluated using 32-bit arithmetic.
>>
>> Addresses-Coverity-ID: 1503062 ("Unintentional integer overflow")
>> Fixes: dafcf4ed8392 ("iio: hrtimer: Allow sub Hz granularity")
>> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
> 
> Thanks, Applied to the togreg branch of iio.git and pushed out as testing
> for 0-day to poke at it.

Awesome. :)

Thanks, Jonathan.

--
Gustavo

      reply	other threads:[~2021-04-06 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 20:58 [PATCH][next] iio: hrtimer-trigger: Fix potential integer overflow in iio_hrtimer_store_sampling_frequency Gustavo A. R. Silva
2021-04-05 16:26 ` Jonathan Cameron
2021-04-06 10:13   ` Gustavo A. R. Silva [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=ec7abed3-1685-8ae0-1a89-d9fc4ee76275@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=gustavoars@kernel.org \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).