Skip to content

Commit

Permalink
spi: davinci: fix a NULL pointer dereference
Browse files Browse the repository at this point in the history
commit 563a53f 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 <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
Cc: [email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
brgl authored and gregkh committed Sep 9, 2018
1 parent 5c45154 commit ae8f22e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-davinci.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,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;

/*
Expand Down

0 comments on commit ae8f22e

Please sign in to comment.