From b1a8e78d173081c303bea88e92a1e1423befca63 Mon Sep 17 00:00:00 2001 From: Tomasz Figa Date: Sun, 11 Aug 2013 02:33:28 +0200 Subject: 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: Tomasz Figa Signed-off-by: Mark Brown --- drivers/spi/spi-s3c64xx.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/spi') diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index c9d0b127..d67384b 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -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); -- cgit v1.1