spi: rockchip: initialize dma_slave_config properly
authorHuibin Hong <huibin.hong@rock-chips.com>
Wed, 10 Oct 2018 09:00:32 +0000 (11:00 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 11 Oct 2018 14:11:45 +0000 (15:11 +0100)
The rxconf and txconf structs are allocated on the
stack, so make sure we zero them before filling out
the relevant fields.

Signed-off-by: Huibin Hong <huibin.hong@rock-chips.com>
Signed-off-by: Emil Renner Berthing <kernel@esmil.dk>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-rockchip.c

index fdcf3076681b5eeffb1885b428c8d00ff2682d2f..185bbdce62b1467acbe833255f3fe79e4fad0840 100644 (file)
@@ -445,6 +445,9 @@ static int rockchip_spi_prepare_dma(struct rockchip_spi *rs)
        struct dma_slave_config rxconf, txconf;
        struct dma_async_tx_descriptor *rxdesc, *txdesc;
 
+       memset(&rxconf, 0, sizeof(rxconf));
+       memset(&txconf, 0, sizeof(txconf));
+
        spin_lock_irqsave(&rs->lock, flags);
        rs->state &= ~RXBUSY;
        rs->state &= ~TXBUSY;