]> Git Repo - linux.git/commitdiff
spi: davinci: fix a NULL pointer dereference
authorBartosz Golaszewski <[email protected]>
Fri, 10 Aug 2018 09:13:52 +0000 (11:13 +0200)
committerMark Brown <[email protected]>
Fri, 10 Aug 2018 10:48:37 +0000 (11:48 +0100)
On non-OF systems spi->controlled_data may be NULL. This causes a NULL
pointer derefence on dm365-evm.

Signed-off-by: Bartosz Golaszewski <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
drivers/spi/spi-davinci.c

index 60d59b003aa4339752c97e5c27ba11d15f4d4390..4ffc0f495be83e20cfe1ed042b27b3e7ca2c1b41 100644 (file)
@@ -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;
 
        /*
This page took 0.046531 seconds and 4 git commands to generate.