Skip to content

Commit

Permalink
spi: dw: fix kernel crash due to NULL pointer dereference
Browse files Browse the repository at this point in the history
The obvious fix after the commit d9c73bb "spi: dw: add support for gpio
controlled chip select". This patch fixes the issue by using locally defined
temporary variable.

Fixes: d9c73bb (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>
  • Loading branch information
Andy Shevchenko authored and Mark Brown committed Aug 27, 2014
1 parent c9d5d6f commit 08a707b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/spi/spi-dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 08a707b

Please sign in to comment.