Skip to content

Commit

Permalink
spi-imx: initialize complete config struct
Browse files Browse the repository at this point in the history
Otherwise the config function uses random data from the stack.  This
didn't stick out because config is called once more in the chipselect
function with correct parameters.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sascha Hauer <s.hauer@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Uwe Kleine-König authored and Linus Torvalds committed Oct 1, 2009
1 parent 4388eb1 commit d1c627b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/spi/spi_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ static int spi_imx_setupxfer(struct spi_device *spi,
config.bpw = t ? t->bits_per_word : spi->bits_per_word;
config.speed_hz = t ? t->speed_hz : spi->max_speed_hz;
config.mode = spi->mode;
config.cs = spi_imx->chipselect[spi->chip_select];

if (!config.speed_hz)
config.speed_hz = spi->max_speed_hz;
Expand Down

0 comments on commit d1c627b

Please sign in to comment.