From: Jonathan Cameron <jic23@kernel.org>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
Alexandru-Catalin Ionita <alexandru-catalin.ionita@nxp.com>,
"Radu Pirea (NXP OSS)" <radu-nicolae.pirea@oss.nxp.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
<linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: adc: nxp-sar-adc: fix division by zero in write_raw
Date: Fri, 15 May 2026 12:03:53 +0100 [thread overview]
Message-ID: <20260515120353.4f9d08de@jic23-huawei> (raw)
In-Reply-To: <20260420153418.21ef8f03@jic23-huawei>
On Mon, 20 Apr 2026 15:34:18 +0100
Jonathan Cameron <jic23@kernel.org> wrote:
> On Wed, 1 Apr 2026 18:29:24 +0300
> Antoniu Miclaus <antoniu.miclaus@analog.com> wrote:
>
> > Add a validation check for the sampling frequency value before using it
> > as a divisor. A user writing zero or a negative value to the
> > sampling_frequency sysfs attribute triggers a division by zero in the
> > kernel.
> >
> > Also prevent unsigned integer underflow when the computed cycle count is
> > smaller than NXP_SAR_ADC_CONV_TIME, which would wrap the u32 inpsamp to
> > a huge value.
> >
> > Fixes: fdee77dea4b6 ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
This tag is wrong. I only just noticed when running final tests
before sending a pull request. I obviously missed running them
earlier but please be very careful to get these right as I have
to rebase whenever one gets past me.
Correct hash is 4434072a893e
Jonathan
prev parent reply other threads:[~2026-05-15 11:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 15:29 [PATCH] iio: adc: nxp-sar-adc: fix division by zero in write_raw Antoniu Miclaus
2026-04-20 14:34 ` Jonathan Cameron
2026-05-15 11:03 ` Jonathan Cameron [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=20260515120353.4f9d08de@jic23-huawei \
--to=jic23@kernel.org \
--cc=alexandru-catalin.ionita@nxp.com \
--cc=antoniu.miclaus@analog.com \
--cc=daniel.lezcano@linaro.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=radu-nicolae.pirea@oss.nxp.com \
/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