Skip to content

Commit

Permalink
spi: rockchip: initialize dma_slave_config properly
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Huibin Hong authored and Mark Brown committed Oct 11, 2018
1 parent 940ec77 commit dd8fd2c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/spi/spi-rockchip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit dd8fd2c

Please sign in to comment.