From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@intel.com>
Cc: "Miclaus, Antoniu" <Antoniu.Miclaus@analog.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Lars-Peter Clausen <lars@metafoo.de>,
"Hennerich, Michael" <Michael.Hennerich@analog.com>,
David Lechner <dlechner@baylibre.com>,
"Sa, Nuno" <Nuno.Sa@analog.com>,
Andy Shevchenko <andy@kernel.org>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] iio: frequency: admv1013: fix NULL pointer dereference on str
Date: Sat, 7 Mar 2026 12:11:31 +0000 [thread overview]
Message-ID: <20260307121117.1429c342@jic23-huawei> (raw)
In-Reply-To: <aalSN21HiRi9g8x6@ashevche-desk.local>
On Thu, 5 Mar 2026 11:51:51 +0200
Andy Shevchenko <andriy.shevchenko@intel.com> wrote:
> On Thu, Mar 05, 2026 at 09:44:35AM +0000, Miclaus, Antoniu wrote:
> > > -----Original Message-----
> > > From: Andy Shevchenko <andy.shevchenko@gmail.com>
> > > Sent: Thursday, March 5, 2026 11:36 AM
> > > On Thu, Mar 5, 2026 at 11:15 AM Antoniu Miclaus
> > > <antoniu.miclaus@analog.com> wrote:
>
> ...
>
> > > > static int admv1013_init(struct admv1013_state *st, int vcm_uv)
> > >
> > > > - data = FIELD_PREP(ADMV1013_QUAD_SE_MODE_MSK, st-
> > > >quad_se_mode);
> > > > + switch (st->quad_se_mode) {
> > > > + case ADMV1013_SE_MODE_POS:
> > > > + data = 6;
> > > > + break;
> > > > + case ADMV1013_SE_MODE_NEG:
> > > > + data = 9;
> > > > + break;
> > > > + case ADMV1013_SE_MODE_DIFF:
> > > > + data = 12;
> > > > + break;
> > > > + default:
> > > > + return -EINVAL;
> > > > + }
> > >
> > > Oh, I haven't realised that it can be done like this. I have in mind
> > > just to have a switch in the probe, so we don't need to do that again
> > > and again. Otherwise looks good to me.
> >
> > Hmm, the _init() function is called only in the probe.
>
> Ah, missed that. Then we are good.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Unfortunately we have some cleanup quite a way back in my tree for this cycle
and I'm not keen to rebase to drop it all. So we'll need to manually back port
this after it merges in the next merge window.
If we need to do it more urgently I'll need a patch against togreg-fixes. Let me know
if you think this is necessary. For now I've applied it on the testing branch.
Jonathan
>
> > I think it makes a bit more sense to be here where we handle all the initial
> > register configurations.
>
> Agree.
>
prev parent reply other threads:[~2026-03-07 12:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-05 9:14 Antoniu Miclaus
2026-03-05 9:35 ` Andy Shevchenko
2026-03-05 9:44 ` Miclaus, Antoniu
2026-03-05 9:51 ` Andy Shevchenko
2026-03-07 12:11 ` 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=20260307121117.1429c342@jic23-huawei \
--to=jic23@kernel.org \
--cc=Antoniu.Miclaus@analog.com \
--cc=Michael.Hennerich@analog.com \
--cc=Nuno.Sa@analog.com \
--cc=andriy.shevchenko@intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=andy@kernel.org \
--cc=dlechner@baylibre.com \
--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
all inboxes | Powered by JetHome®