[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZsxYUV_GhYHNtyCk@smile.fi.intel.com>
Date: Mon, 26 Aug 2024 13:26:25 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Jonathan Cameron <jic23@...nel.org>
Cc: Vasileios Amoiridis <vassilisamir@...il.com>, lars@...afoo.de,
robh@...nel.org, krzk+dt@...nel.org, conor+dt@...nel.org,
ang.iglesiasg@...il.com, linus.walleij@...aro.org,
biju.das.jz@...renesas.com, javier.carrasco.cruz@...il.com,
semen.protsenko@...aro.org, 579lpy@...il.com, ak@...klinger.de,
linux-iio@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 6/7] iio: pressure: bmp280: Add data ready trigger
support
On Mon, Aug 26, 2024 at 11:01:50AM +0100, Jonathan Cameron wrote:
> On Sat, 24 Aug 2024 14:02:22 +0200
> Vasileios Amoiridis <vassilisamir@...il.com> wrote:
> > On Fri, Aug 23, 2024 at 11:06:28PM +0300, Andy Shevchenko wrote:
> > > On Fri, Aug 23, 2024 at 08:17:13PM +0200, Vasileios Amoiridis wrote:
...
> > > > + fwnode = dev_fwnode(data->dev);
> > > > + if (!fwnode)
> > > > + return -ENODEV;
> > >
> > > Why do you need this? The below will fail anyway.
> >
> > Because If I don't make this check then fwnode might be garbage and I will
> > pass garbage to the fwnode_irq_get() function. Or do I miss something?
> It checks for NULL which is all it can actually be and returns a suitable
> error code if it is.
Actually not. It may be NULL, error pointer, or valid. So, for a bare minimum
this check is not full (and again, fwnode APIs should validate fwnode before
accessing them where it makes sense; if fwnode_irq_get() does not do that or
misses the case(s), it has to be improved).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists