From: Jonathan Cameron <jic23@kernel.org>
To: Fernando Yang <hagisf@usp.br>
Cc: linux-iio@vger.kernel.org, Michael.Hennerich@analog.com, lars@metafoo.de
Subject: Re: [PATCH v2 1/3] iio: adc: ad7266: Fix variable checking bug
Date: Sat, 8 Jun 2024 15:41:06 +0100 [thread overview]
Message-ID: <20240608154106.0b0739fa@jic23-huawei> (raw)
In-Reply-To: <20240603180757.8560-1-hagisf@usp.br>
On Mon, 3 Jun 2024 15:07:54 -0300
Fernando Yang <hagisf@usp.br> wrote:
> The ret variable was not checked after iio_device_release_direct_mode(),
> which could possibly cause errors
>
> Signed-off-by: Fernando Yang <hagisf@usp.br>
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,
prev parent reply other threads:[~2024-06-08 14:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-08 15:54 [PATCH] iio: adc: adc7266: Use iio_device_claim_direct_scoped() Fernando Yang
2024-05-11 4:16 ` Marcelo Schmitt
2024-05-11 13:30 ` Jonathan Cameron
2024-06-03 18:07 ` [PATCH v2 1/3] iio: adc: ad7266: Fix variable checking bug Fernando Yang
2024-06-03 18:07 ` [PATCH v2 2/3] iio: adc: ad7266: Use iio_device_claim_direct_scoped() Fernando Yang
2024-06-08 5:21 ` Marcelo Schmitt
2024-06-03 18:07 ` [PATCH v2 3/3] iio: adc: ad7266: Fix codestyle error Fernando Yang
2024-06-08 5:29 ` Marcelo Schmitt
2024-06-08 5:06 ` [PATCH v2 1/3] iio: adc: ad7266: Fix variable checking bug Marcelo Schmitt
2024-06-08 14:11 ` Jonathan Cameron
2024-06-08 14:41 ` 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=20240608154106.0b0739fa@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=hagisf@usp.br \
--cc=lars@metafoo.de \
--cc=linux-iio@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