mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: <Ariana.Lazar@microchip.com>
To: <jic23@kernel.org>, <devnexen@gmail.com>
Cc: <joshua.crofts1@gmail.com>, <stable@vger.kernel.org>,
	<nuno.sa@analog.com>, <dlechner@baylibre.com>,
	<linux-iio@vger.kernel.org>, <andy@kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] iio: dac: mcp47feb02: reject out-of-range raw values
Date: Tue, 3 Nov 2026 13:10:58 +0000	[thread overview]
Message-ID: <3ccc9b0ecc2f1bc3eba6b0f4ca4d8f81e5f30a31.camel@microchip.com> (raw)
In-Reply-To: <20261025215707.4fe42618@jic23-hlaptop>

Hi Jonathan,

I tested this patch on both I2C and SPI parts and found no issues.
Thank you David for your contribution.

Tested-by: Ariana Lazar <ariana.lazar@microchip.com>

Best regards,
Ariana

> 
> Good catch but given the fix will go in the same cycle as the driver
> I've dropped the table tag.
> 
> This is more about how I choose to queue this up than anything could
> know.  I might have held it for next merge window in which case
> it would have wanted the stable tag.
> 
> Applied to the fixes-togreg branch of iio.git.  I've just rebased
> that
> to reflect the char-misc pull going into Linus' tree (which was
> needed
> to get the driver for this patch). I'll rebase again on rc1 once
> available.
> 
> Given I'll be rebasing anyway, extra tags welcome (and I didn't hold
> off on applying as I might have done if aiming for no rebasing).
> Ariana,
> please take a look at this one.
> 
> Thanks,
> 
> Jonathan
> 
> 
> 
> > Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
> > Signed-off-by: David Carlier <devnexen@gmail.com>
> > ---
> > Found by LLM-assisted code inspection, reviewed and verified by
> > hand.
> > Build tested with W=1 (=m and =y) only; no hardware was available
> > for
> > runtime testing.
> > 
> > v2:
> > - Use GENMASK() for the upper bound so it is safe up to 32 bits
> > (Andy)
> > - Drop the Assisted-by tag, removed from the docs in 1e035297ffda
> > (Joshua)
> > - Move the testing note below the --- (Joshua)
> > 
> > v1:
> > https://lore.kernel.org/all/20261024214423.865635-1-devnexen@gmail.com/
> > ---
> >  drivers/iio/dac/mcp47feb02-core.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/iio/dac/mcp47feb02-core.c
> > b/drivers/iio/dac/mcp47feb02-core.c
> > index 88bffbab0854..b5a2ac4a2e67 100644
> > --- a/drivers/iio/dac/mcp47feb02-core.c
> > +++ b/drivers/iio/dac/mcp47feb02-core.c
> > @@ -696,6 +696,9 @@ static int mcp47feb02_write_raw(struct iio_dev
> > *indio_dev, struct iio_chan_spec
> > 
> >       switch (mask) {
> >       case IIO_CHAN_INFO_RAW:
> > +             if (val < 0 || val > GENMASK(data->chip_features-
> > >resolution - 1, 0))
> > +                     return -EINVAL;
> > +
> >               ret = regmap_write(data->regmap, REG_ADDR(ch-
> > >address), val);
> >               if (ret)
> >                       return ret;
> 


      reply	other threads:[~2026-11-03 13:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-25 21:18 David Carlier
2026-10-25 21:36 ` Andy Shevchenko
2026-10-25 21:57 ` Jonathan Cameron
2026-11-03 13:10   ` Ariana.Lazar [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=3ccc9b0ecc2f1bc3eba6b0f4ca4d8f81e5f30a31.camel@microchip.com \
    --to=ariana.lazar@microchip.com \
    --cc=andy@kernel.org \
    --cc=devnexen@gmail.com \
    --cc=dlechner@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=joshua.crofts1@gmail.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nuno.sa@analog.com \
    --cc=stable@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

all inboxes | Powered by JetHome®