Re: [PATCH v8 2/8] iio: dac: ad5686: missing NULL check on match data

From: Andy Shevchenko

Date: Fri Jul 17 2026 - 04:19:53 EST


On Fri, Jul 17, 2026 at 07:51:35AM +0100, Rodrigo Alencar wrote:
> On 16/07/26 21:42, Andy Shevchenko wrote:
> > On Thu, Jul 16, 2026 at 01:14:18PM +0100, Rodrigo Alencar via B4 Relay wrote:

...

> > > struct iio_dev *indio_dev;
> > > int ret, i;
> >
> > Move an assignment here as well.
> >
> > chip_info = ...
>
> assignment? this is an input param validation

Can we make sure we always get a correct one to begin with?
With that an assignment and check can be coupled together.
Also consider use -ENODATA as it's most likely comes from
driver_data.

> > > + if (!chip_info)
> > > + return -ENODEV;

--
With Best Regards,
Andy Shevchenko