summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-08-27 19:26:08 +0300
committerMark Brown <broonie@linaro.org>2014-08-27 17:32:46 +0100
commit08a707b87874eaaa0f336ab604ecd6e5e9f286dd (patch)
treeaad9b04c1993b91b8b5266ddb108f716b0542aab /drivers/spi
parentc9d5d6fe168fd45a4dfdd0116affe708789b4702 (diff)
downloadblackbird-op-linux-08a707b87874eaaa0f336ab604ecd6e5e9f286dd.tar.gz
blackbird-op-linux-08a707b87874eaaa0f336ab604ecd6e5e9f286dd.zip
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-dw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 29f33143b795..670f0627f3bf 100644
--- a/drivers/spi/spi-dw.c
+++ b/drivers/spi/spi-dw.c
@@ -271,7 +271,7 @@ static void giveback(struct dw_spi *dws)
transfer_list);
if (!last_transfer->cs_change)
- spi_chip_sel(dws, dws->cur_msg->spi, 0);
+ spi_chip_sel(dws, msg->spi, 0);
spi_finalize_current_message(dws->master);
}
OpenPOWER on IntegriCloud