drivers/iio/adc/ad4134.c | 1 - 1 file changed, 1 deletion(-)
devm_mux_state_get() 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>
Reviewed-by: Joshua Crofts <crofts@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
---
Changes in v2:
- Update commit message as suggested by Andy Shevchenko.
- Add Reviewed-by tags from Andy Shevchenko and Joshua Crofts.
---
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
On Thu, 5 Nov 2026 11:31:20 +0800
Chen Ni <nichen@iscas.ac.cn> wrote:
> devm_mux_state_get() 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>
Ideally your Signed-off-by tag should be the last one in the tag
block. No need to resend however, this can be tweaked when applying.
--
Kind regards,
Joshua Crofts
© 2016 - 2026 Red Hat, Inc.