]> git.karo-electronics.de Git - linux-beck.git/commitdiff
spi: s3c64xx: Zero dma_slave_config struct in prepare_dma()
authorTomasz Figa <tomasz.figa@gmail.com>
Sun, 11 Aug 2013 00:33:28 +0000 (02:33 +0200)
committerMark Brown <broonie@linaro.org>
Sun, 11 Aug 2013 13:06:30 +0000 (14:06 +0100)
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 <tomasz.figa@gmail.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/spi/spi-s3c64xx.c

index c9d0b1273be9564cb76943f32958224d34b2ed02..d67384b3c31859b11f373808ede986925a52a6ce 100644 (file)
@@ -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);