spi-imx: initialize complete config struct
authorUwe Kleine-König <[email protected]>
Thu, 1 Oct 2009 22:44:32 +0000 (15:44 -0700)
committerLinus Torvalds <[email protected]>
Thu, 1 Oct 2009 23:11:17 +0000 (16:11 -0700)
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 <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Guennadi Liakhovetski <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
drivers/spi/spi_imx.c

index b6a8149220fb7c11826209e80cfc47e85de45775..2fec1170b6c0dff1e215c07b9110a275964a0cb0 100644 (file)
@@ -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;