]> git.itanic.dy.fi Git - linux-stable/commitdiff
mmc: moxart: Fix issue with uninitialized dma_slave_config
authorTony Lindgren <tony@atomide.com>
Tue, 10 Aug 2021 08:16:44 +0000 (11:16 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 15 Sep 2021 08:02:27 +0000 (10:02 +0200)
[ Upstream commit ee5165354d498e5bceb0b386e480ac84c5f8c28c ]

Depending on the DMA driver being used, the struct dma_slave_config may
need to be initialized to zero for the unused data.

For example, we have three DMA drivers using src_port_window_size and
dst_port_window_size. If these are left uninitialized, it can cause DMA
failures.

For moxart, this is probably not currently an issue but is still good to
fix though.

Fixes: 1b66e94e6b99 ("mmc: moxart: Add MOXA ART SD/MMC driver")
Cc: Jonas Jensen <jonas.jensen@gmail.com>
Cc: Vinod Koul <vkoul@kernel.org>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20210810081644.19353-3-tony@atomide.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/moxart-mmc.c

index bde2988875797aecbb74b1208a1fec104f9ffa57..6c9d38132f74c2af113192366841d88f83bf629c 100644 (file)
@@ -628,6 +628,7 @@ static int moxart_probe(struct platform_device *pdev)
                         host->dma_chan_tx, host->dma_chan_rx);
                host->have_dma = true;
 
+               memset(&cfg, 0, sizeof(cfg));
                cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
                cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;