Re: [PATCH v8 2/8] iio: dac: ad5686: missing NULL check on match data
From: Rodrigo Alencar
Date: Fri Jul 17 2026 - 05:32:28 EST
On 17/07/26 11:15, Andy Shevchenko wrote:
> 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.
I suppose you are suggesting to move the check to the bus code with:
info = i2c_get_match_data(i2c);
if (!info)
return -ENODATA;
rather than here in the core/common code.
> > > > + if (!chip_info)
> > > > + return -ENODEV;
--
Kind regards,
Rodrigo Alencar