Linux SPI subsystem development
 help / color / mirror / Atom feed
* [Fixes: PATCH v1] spi: dw: fix kernel crash due to NULL pointer dereference
@ 2014-08-27 16:26 Andy Shevchenko
  2014-08-27 16:33 ` Mark Brown
       [not found] ` <1409156768-28461-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2014-08-27 16:26 UTC (permalink / raw)
  To: Baruch Siach, Mark Brown, linux-spi; +Cc: Andy Shevchenko, stable

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.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: <stable@vger.kernel.org> # v3.16+
---
 drivers/spi/spi-dw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c
index 29f3314..670f062 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);
 }
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-27 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 16:26 [Fixes: PATCH v1] spi: dw: fix kernel crash due to NULL pointer dereference Andy Shevchenko
2014-08-27 16:33 ` Mark Brown
     [not found] ` <1409156768-28461-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2014-08-27 16:39   ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox