* [PATCH] dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it
@ 2022-10-17 13:14 Amelie Delaunay
2022-10-19 13:31 ` Vinod Koul
0 siblings, 1 reply; 2+ messages in thread
From: Amelie Delaunay @ 2022-10-17 13:14 UTC (permalink / raw)
To: Vinod Koul, Maxime Coquelin, Alexandre Torgue, Amelie Delaunay
Cc: dmaengine, linux-stm32, linux-arm-kernel, linux-kernel
New bool m2m_hw has been added at the end of stm32_mdma_chan_config struct
to support the STM32 DMA MDMA chaining.
m2m_hw is set true in stm32_mdma_slave_config() if peripheral_size is set,
but m2m_hw is never initialized false.
To ensure this case, and any further new update of the structure, memset it
to 0 before using it.
Fixes: 696874322771 ("dmaengine: stm32-mdma: add support to be triggered by STM32 DMA")
Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
---
drivers/dma/stm32-mdma.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/dma/stm32-mdma.c b/drivers/dma/stm32-mdma.c
index e28acbcb53f4..b9d4c843635f 100644
--- a/drivers/dma/stm32-mdma.c
+++ b/drivers/dma/stm32-mdma.c
@@ -1539,6 +1539,7 @@ static struct dma_chan *stm32_mdma_of_xlate(struct of_phandle_args *dma_spec,
return NULL;
}
+ memset(&config, 0, sizeof(config));
config.request = dma_spec->args[0];
config.priority_level = dma_spec->args[1];
config.transfer_config = dma_spec->args[2];
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it
2022-10-17 13:14 [PATCH] dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it Amelie Delaunay
@ 2022-10-19 13:31 ` Vinod Koul
0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2022-10-19 13:31 UTC (permalink / raw)
To: Amelie Delaunay
Cc: Maxime Coquelin, Alexandre Torgue, dmaengine, linux-stm32,
linux-arm-kernel, linux-kernel
On 17-10-22, 15:14, Amelie Delaunay wrote:
> New bool m2m_hw has been added at the end of stm32_mdma_chan_config struct
> to support the STM32 DMA MDMA chaining.
>
> m2m_hw is set true in stm32_mdma_slave_config() if peripheral_size is set,
> but m2m_hw is never initialized false.
>
> To ensure this case, and any further new update of the structure, memset it
> to 0 before using it.
Applied, thanks
--
~Vinod
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-19 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-17 13:14 [PATCH] dmaengine: stm32-mdma: memset stm32_mdma_chan_config struct before using it Amelie Delaunay
2022-10-19 13:31 ` Vinod Koul
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox