Linux IIO development
 help / color / mirror / Atom feed
From: Cai Huoqing <cai.huoqing@linux.dev>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	Cosmin Tanislav <cosmin.tanislav@analog.com>
Subject: Re: [PATCH] iio:addac:ad74413r: Fix uninitialized ret in a path that won't be hit.
Date: Tue, 21 Dec 2021 21:20:14 +0800	[thread overview]
Message-ID: <20211221132014.GA27963@chq-T47> (raw)
In-Reply-To: <20211220164726.3136307-1-jic23@kernel.org>

On 20 12月 21 16:47:26, Jonathan Cameron wrote:
> From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> 
> I don't believe it's possible to hit this, because we drop
> out of __iio_update_buffers() earlier in the event of an empty
> list.  However, that is not visible to the compiler so lets
> return an error if we do hit the loop with an empty bitmask.
> 
> Fixes: 5d97d9e9a703 ("iio: addac: ad74413r: fix off by one in ad74413r_parse_channel_config()")
> Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>
> ---
>  drivers/iio/addac/ad74413r.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/addac/ad74413r.c b/drivers/iio/addac/ad74413r.c
> index 289d254943e1..5271073bb74e 100644
> --- a/drivers/iio/addac/ad74413r.c
> +++ b/drivers/iio/addac/ad74413r.c
> @@ -843,7 +843,7 @@ static int ad74413r_update_scan_mode(struct iio_dev *indio_dev,
>  	u8 *rx_buf = &st->adc_samples_buf.rx_buf[-1 * AD74413R_FRAME_SIZE];
>  	u8 *tx_buf = st->adc_samples_tx_buf;
>  	unsigned int channel;
> -	int ret;
> +	int ret = -EINVAL;
Reviewed-by: Cai Huoqing <cai.huoqing@linux.dev>
>  
>  	mutex_lock(&st->lock);
>  
> -- 
> 2.34.1
> 

      parent reply	other threads:[~2021-12-21 13:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-20 16:47 [PATCH] iio:addac:ad74413r: Fix uninitialized ret in a path that won't be hit Jonathan Cameron
2021-12-20 16:51 ` Jonathan Cameron
2021-12-21 13:20 ` Cai Huoqing [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=20211221132014.GA27963@chq-T47 \
    --to=cai.huoqing@linux.dev \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=cosmin.tanislav@analog.com \
    --cc=jic23@kernel.org \
    --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