Skip to contentSkip to conversation

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

PATCH Applied Andy Shevchenko 3 participants 3 messages Aug 27, 2014 1 message not in the archive SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 drivers/spi/spi-dw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-dw.c +1 -1
index 29f3314..670f062 100644
@@ -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);
 }
Signature · 1 line
2.1.0
maintainer Applied
#1 lore raw
Quoted 3 lines · Andy Shevchenko

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.

A message that is not in the archive (sent off-list or not yet received): 1409156768-28461-1-git-send-email-andriy.shevchenko-VuQAYsv1563Yd54FQh9/[email protected]