On Mon, 3 Jun 2024 15:07:54 -0300 Fernando Yang <hagisf@xxxxxx> wrote: > The ret variable was not checked after iio_device_release_direct_mode(), > which could possibly cause errors > > Signed-off-by: Fernando Yang <hagisf@xxxxxx> For future reference, in IIO at least (and 'most' of the rest of the kernel) don't send a patch set in reply to a previous one. I can't remember who once gave a good explanation of why, but key to limited time management when reviewing kernel patches is we start with latest info and maybe never get back to the beginning. Given everyone uses threading email clients, your email is a lot of pages up from where I'd start if I wasn't aiming to clear the whole IIO backlog this weekend... > --- > drivers/iio/adc/ad7266.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/iio/adc/ad7266.c b/drivers/iio/adc/ad7266.c > index 353a97f9c..13ea8a107 100644 > --- a/drivers/iio/adc/ad7266.c > +++ b/drivers/iio/adc/ad7266.c > @@ -157,6 +157,8 @@ static int ad7266_read_raw(struct iio_dev *indio_dev, > ret = ad7266_read_single(st, val, chan->address); > iio_device_release_direct_mode(indio_dev); > > + if (ret < 0) > + return ret; > *val = (*val >> 2) & 0xfff; > if (chan->scan_type.sign == 's') > *val = sign_extend32(*val,