提交 b1a8e78d 编写于 作者: T Tomasz Figa 提交者: Mark Brown

spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()

Not all fields of dma_slave_config struct are being initialized by
prepare_dma() function, leaving those which are not in undefined state,
which can confuse DMA drivers using them.

This patch adds call to memset() to zero the struct before initializing
a subset of its fields.
Signed-off-by: NTomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 b998aca8
......@@ -392,6 +392,8 @@ static void prepare_dma(struct s3c64xx_spi_dma_data *dma,
struct scatterlist sg;
struct dma_async_tx_descriptor *desc;
memset(&config, 0, sizeof(config));
if (dma->direction == DMA_DEV_TO_MEM) {
sdd = container_of((void *)dma,
struct s3c64xx_spi_driver_data, rx_dma);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册