Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

spi: dw: fix kernel crash due to NULL pointer dereference

The obvious fix after the commit d9c73bb8a3a5 "spi: dw: add support for gpio
controlled chip select". This patch fixes the issue by using locally defined
temporary variable.

Fixes: d9c73bb8a3a5 (spi: dw: add support for gpio controlled chip select)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: <stable@vger.kernel.org>

authored by

Andy Shevchenko and committed by
Mark Brown
08a707b8 c9d5d6fe

+1 -1
+1 -1
drivers/spi/spi-dw.c
··· 271 271 transfer_list); 272 272 273 273 if (!last_transfer->cs_change) 274 - spi_chip_sel(dws, dws->cur_msg->spi, 0); 274 + spi_chip_sel(dws, msg->spi, 0); 275 275 276 276 spi_finalize_current_message(dws->master); 277 277 }