mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] iio: adc: ad4134: Fix duplicate data_read mux state request
@ 2026-11-04  4:47 Chen Ni
  2026-11-04  8:09 ` Joshua Crofts
  2026-11-04 11:02 ` Andy Shevchenko
  0 siblings, 2 replies; 3+ messages in thread
From: Chen Ni @ 2026-11-04  4:47 UTC (permalink / raw)
  To: Marcelo Schmitt, Jonathan Cameron
  Cc: Nuno Sá,
	Michael Hennerich, David Lechner, Andy Shevchenko, linux,
	linux-iio, linux-kernel, Chen Ni

devm_mux_state_get(dev, "data_read") is called twice in a row. The
second call's result is stored directly into
st->mux_st[AD4134_DOUT0_INPUT] without error checking, and then
immediately overwritten by the first call's result.

Remove the duplicate call and check the return value before saving the
state.

Fixes: f12ecb3e147b ("iio: adc: ad4134: Support SPI 4-wire mode")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
---
 drivers/iio/adc/ad4134.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/iio/adc/ad4134.c b/drivers/iio/adc/ad4134.c
index bc6407ae25e0..35fe387b9ac8 100644
--- a/drivers/iio/adc/ad4134.c
+++ b/drivers/iio/adc/ad4134.c
@@ -1112,7 +1112,6 @@ static int ad4134_probe(struct spi_device *spi)
 		st->mux_st[AD4134_SDO_INPUT] = mux_st;
 
 		mux_st = devm_mux_state_get(dev, "data_read");
-		st->mux_st[AD4134_DOUT0_INPUT] = devm_mux_state_get(dev, "data_read");
 		if (IS_ERR(mux_st))
 			return dev_err_probe(dev, PTR_ERR(mux_st),
 					     "failed to get data_read mux-state\n");
-- 
2.25.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-04 11:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04  4:47 [PATCH] iio: adc: ad4134: Fix duplicate data_read mux state request Chen Ni
2026-11-04  8:09 ` Joshua Crofts
2026-11-04 11:02 ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®