All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Rodrigo Alencar via B4 Relay
	<devnull+rodrigo.alencar.analog.com@kernel.org>
Cc: rodrigo.alencar@analog.com,
	Michael Auchter <michael.auchter@ni.com>,
	linux@analog.com, linux-iio@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	David Lechner <dlechner@baylibre.com>,
	Andy Shevchenko <andy@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	sashiko-bot@kernel.org
Subject: Re: [PATCH v7 1/7] iio: dac: ad5696: properly check i2c_transfer() return value
Date: Sun, 12 Jul 2026 02:58:32 +0100	[thread overview]
Message-ID: <20260712025832.707cf448@jic23-huawei> (raw)
In-Reply-To: <20260710-ad5686-new-features-v7-1-1bcc8c280e4d@analog.com>

On Fri, 10 Jul 2026 12:20:45 +0100
Rodrigo Alencar via B4 Relay <devnull+rodrigo.alencar.analog.com@kernel.org> wrote:

> From: Rodrigo Alencar <rodrigo.alencar@analog.com>
> 
> Verify that the expected number of i2c messages were transferred when
> ad5686_i2c_read() is called. This issue exists since the support for I2C
> devices where first introduced.
> 
> Fixes: 4177381b4401 ("iio:dac:ad5686: Add AD5671R/75R/94/94R/95R/96/96R support")
> Reported-by: sashiko-bot@kernel.org
> Closes: https://lore.kernel.org/all/20260705114746.1485F1F000E9@smtp.kernel.org/
> Signed-off-by: Rodrigo Alencar <rodrigo.alencar@analog.com>
FWIW, as I understand it, these are vanishingly rare unless the device is
doing something unusual so I'll leave this for merge with the rest of the series. 

Jonathan

> ---
>  drivers/iio/dac/ad5696-i2c.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/dac/ad5696-i2c.c b/drivers/iio/dac/ad5696-i2c.c
> index 279309329b64..6f726e6301a6 100644
> --- a/drivers/iio/dac/ad5696-i2c.c
> +++ b/drivers/iio/dac/ad5696-i2c.c
> @@ -40,8 +40,8 @@ static int ad5686_i2c_read(struct ad5686_state *st, u8 addr)
>  				      0x00);
>  
>  	ret = i2c_transfer(i2c->adapter, msg, 2);
> -	if (ret < 0)
> -		return ret;
> +	if (ret != 2)
> +		return ret < 0 ? ret : -EIO;
>  
>  	return be16_to_cpu(st->data[0].d16);
>  }
> 


  parent reply	other threads:[~2026-07-12  1:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-10 11:20 [PATCH v7 0/7] New features for the AD5686 IIO driver Rodrigo Alencar via B4 Relay
2026-07-10 11:20 ` Rodrigo Alencar
2026-07-10 11:20 ` [PATCH v7 1/7] iio: dac: ad5696: properly check i2c_transfer() return value Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-10 11:31   ` sashiko-bot
2026-07-12  1:58   ` Jonathan Cameron [this message]
2026-07-12  6:58   ` Andy Shevchenko
2026-07-10 11:20 ` [PATCH v7 2/7] iio: dac: ad5686: refactor command/data macros Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-10 11:36   ` sashiko-bot
2026-07-12  7:05   ` Andy Shevchenko
2026-07-10 11:20 ` [PATCH v7 3/7] iio: dac: ad5686: introduce sync operation Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-10 11:20 ` [PATCH v7 4/7] iio: dac: ad5686: implement new sync() op for the spi bus Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-11 15:07   ` David Lechner
2026-07-13 16:44     ` Rodrigo Alencar
2026-07-13 16:46       ` Andy Shevchenko
2026-07-12  7:03   ` Andy Shevchenko
2026-07-13 16:18     ` Rodrigo Alencar
2026-07-13 16:44       ` Andy Shevchenko
2026-07-10 11:20 ` [PATCH v7 5/7] iio: dac: ad5686: read_raw/write_raw: use guard(mutex)() Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-11 15:09   ` David Lechner
2026-07-12  7:12     ` Andy Shevchenko
2026-07-10 11:20 ` [PATCH v7 6/7] iio: dac: ad5686: add triggered buffer support Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-11 15:15   ` David Lechner
2026-07-10 11:20 ` [PATCH v7 7/7] iio: dac: ad5686: add gain control support Rodrigo Alencar via B4 Relay
2026-07-10 11:20   ` Rodrigo Alencar
2026-07-11 15:22   ` David Lechner
2026-07-11 15:23 ` [PATCH v7 0/7] New features for the AD5686 IIO driver David Lechner
2026-07-12  2:05   ` Jonathan Cameron

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=20260712025832.707cf448@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=andy@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=devnull+rodrigo.alencar.analog.com@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=gustavoars@kernel.org \
    --cc=kees@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@analog.com \
    --cc=michael.auchter@ni.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    --cc=rodrigo.alencar@analog.com \
    --cc=sashiko-bot@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.