Skip to content

Commit df804d5

Browse files
Peter Ujfalusistorulf
authored andcommitted
mmc: omap: Initialize dma_slave_config to avoid random data in it's fields
It is wrong to use uninitialized dma_slave_config and configure only certain fields as the DMAengine driver might look at non initialized (random data) fields and tries to interpret it. Signed-off-by: Peter Ujfalusi <[email protected]> Signed-off-by: Ulf Hansson <[email protected]>
1 parent e578960 commit df804d5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/mmc/host/omap.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,14 +1016,16 @@ mmc_omap_prepare_data(struct mmc_omap_host *host, struct mmc_request *req)
10161016

10171017
/* Only reconfigure if we have a different burst size */
10181018
if (*bp != burst) {
1019-
struct dma_slave_config cfg;
1020-
1021-
cfg.src_addr = host->phys_base + OMAP_MMC_REG(host, DATA);
1022-
cfg.dst_addr = host->phys_base + OMAP_MMC_REG(host, DATA);
1023-
cfg.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
1024-
cfg.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES;
1025-
cfg.src_maxburst = burst;
1026-
cfg.dst_maxburst = burst;
1019+
struct dma_slave_config cfg = {
1020+
.src_addr = host->phys_base +
1021+
OMAP_MMC_REG(host, DATA),
1022+
.dst_addr = host->phys_base +
1023+
OMAP_MMC_REG(host, DATA),
1024+
.src_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
1025+
.dst_addr_width = DMA_SLAVE_BUSWIDTH_2_BYTES,
1026+
.src_maxburst = burst,
1027+
.dst_maxburst = burst,
1028+
};
10271029

10281030
if (dmaengine_slave_config(c, &cfg))
10291031
goto use_pio;

0 commit comments

Comments
 (0)