summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartosz Golaszewski <bgolaszewski@baylibre.com>2018-08-10 12:13:52 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-09-09 20:55:52 +0300
commitaa1d05c504832dbb17855dd4bd858b1cb263ca7b (patch)
treeb84334ac8d63c07517042ba5495cc310536937da
parent4d3016e56c3d2fdbd5b1a984c4316da3cfbf63a9 (diff)
downloadlinux-aa1d05c504832dbb17855dd4bd858b1cb263ca7b.tar.xz
spi: davinci: fix a NULL pointer dereference
commit 563a53f3906a6b43692498e5b3ae891fac93a4af upstream. 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 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-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 6ddb6ef1fda4..c5bbe08771a4 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;
/*