summaryrefslogtreecommitdiffstats
path: root/drivers/spi/spi-davinci.c
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2018-08-10 11:13:52 +0200
committerMark Brown <broonie@kernel.org>2018-08-10 11:48:37 +0100
commit563a53f3906a6b43692498e5b3ae891fac93a4af (patch)
tree3612714b86b21bf104ffc68a8ccc7c672eb015cc /drivers/spi/spi-davinci.c
parent66b19d762378785d1568b5650935205edfeb0503 (diff)
downloadlinux-563a53f3906a6b43692498e5b3ae891fac93a4af.tar.bz2
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/spi/spi-davinci.c')
-rw-r--r--drivers/spi/spi-davinci.c2
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;
/*