diff mbox

[Fixes:,v1] spi: dw: fix kernel crash due to NULL pointer dereference

Message ID 1409156768-28461-1-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 08a707b87874eaaa0f336ab604ecd6e5e9f286dd
Headers show

Commit Message

Andy Shevchenko Aug. 27, 2014, 4:26 p.m. UTC
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(-)

Comments

Mark Brown Aug. 27, 2014, 4:33 p.m. UTC | #1
On Wed, Aug 27, 2014 at 07:26:08PM +0300, Andy Shevchenko wrote:
> 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.

Applied, thanks.
Mark Brown Aug. 27, 2014, 4:39 p.m. UTC | #2
On Wed, Aug 27, 2014 at 07:26:08PM +0300, Andy Shevchenko wrote:
> 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+

Applied, but to repeat please use Fixes.
diff mbox

Patch

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);
 }