diff options
author | Huibin Hong <huibin.hong@rock-chips.com> | 2018-10-10 12:00:32 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-10-11 17:11:45 +0300 |
commit | dd8fd2cbc73f8650f651da71fc61a6e4f30c1566 (patch) | |
tree | e97dcb2cf99818fe675d6ac0d7f1e22a32660a97 /drivers/spi/spi-rockchip.c | |
parent | 940ec770c295682993d1cccce3081fd7c74fece8 (diff) | |
download | linux-dd8fd2cbc73f8650f651da71fc61a6e4f30c1566.tar.xz |
spi: rockchip: initialize dma_slave_config properly
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>
Diffstat (limited to 'drivers/spi/spi-rockchip.c')
-rw-r--r-- | drivers/spi/spi-rockchip.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index fdcf3076681b..185bbdce62b1 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -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; |