public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: nxp-sar-adc: zero-initialize dma_slave_config
@ 2026-04-06  9:53 Shuvam Pandey
  2026-04-06 13:59 ` David Lechner
  0 siblings, 1 reply; 3+ messages in thread
From: Shuvam Pandey @ 2026-04-06  9:53 UTC (permalink / raw)
  To: Jonathan Cameron, David Lechner
  Cc: Nuno Sá, Andy Shevchenko, linux-iio, linux-kernel,
	Shuvam Pandey

nxp_sar_adc_start_cyclic_dma() only fills the RX-side members of
dma_slave_config before passing it to dmaengine_slave_config().

Zero-initialize the structure so unused members do not contain stack
garbage. Some DMA engines consult optional dma_slave_config fields, so
leaving them uninitialized can cause DMA setup failures.

Fixes: 4434072a893e ("iio: adc: Add the NXP SAR ADC support for the s32g2/3 platforms")
Signed-off-by: Shuvam Pandey <shuvampandey1@gmail.com>
---
 drivers/iio/adc/nxp-sar-adc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/adc/nxp-sar-adc.c b/drivers/iio/adc/nxp-sar-adc.c
index 9efa883c277d..7d7b5a580167 100644
--- a/drivers/iio/adc/nxp-sar-adc.c
+++ b/drivers/iio/adc/nxp-sar-adc.c
@@ -659,7 +659,7 @@ static void nxp_sar_adc_dma_cb(void *data)
 static int nxp_sar_adc_start_cyclic_dma(struct iio_dev *indio_dev)
 {
 	struct nxp_sar_adc *info = iio_priv(indio_dev);
-	struct dma_slave_config config;
+	struct dma_slave_config config = {};
 	struct dma_async_tx_descriptor *desc;
 	int ret;
 
-- 
2.50.0


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

end of thread, other threads:[~2026-04-20 18:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-06  9:53 [PATCH] iio: adc: nxp-sar-adc: zero-initialize dma_slave_config Shuvam Pandey
2026-04-06 13:59 ` David Lechner
2026-04-20 18:07   ` Jonathan Cameron

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