Skip to content

Commit

Permalink
spi: rockchip: initialize dma_slave_config properly
Browse files Browse the repository at this point in the history
[ Upstream commit dd8fd2c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Huibin Hong authored and Greg Kroah-Hartman committed Nov 25, 2019
1 parent 3448238 commit 736d201
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
@@ -444,6 +444,9 @@ static void 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;

0 comments on commit 736d201

Please sign in to comment.