diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2018-08-10 11:13:52 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2018-08-10 11:48:37 +0100 |
commit | 563a53f3906a6b43692498e5b3ae891fac93a4af (patch) | |
tree | 3612714b86b21bf104ffc68a8ccc7c672eb015cc /drivers | |
parent | 66b19d762378785d1568b5650935205edfeb0503 (diff) | |
download | linux-563a53f3906a6b43692498e5b3ae891fac93a4af.tar.gz |
spi: davinci: fix a NULL pointer dereference
On non-OF systems spi->controlled_data may be NULL. This causes a NULL
pointer derefence on dm365-evm.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/spi/spi-davinci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c index 60d59b003aa4..4ffc0f495be8 100644 --- a/drivers/spi/spi-davinci.c +++ b/drivers/spi/spi-davinci.c @@ -217,7 +217,7 @@ static void davinci_spi_chipselect(struct spi_device *spi, int value) pdata = &dspi->pdata; /* program delay transfers if tx_delay is non zero */ - if (spicfg->wdelay) + if (spicfg && spicfg->wdelay) spidat1 |= SPIDAT1_WDEL; /* |