diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2014-09-12 15:11:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-10-30 09:40:11 -0700 |
commit | 63d84b1a46957b3ecc56af8087220c0df42e0ef2 (patch) | |
tree | f7317f74b8f00a1b5ec2bbd110912f375a6a3241 | |
parent | f2665dce1f0c1939170a33e21a2efd0f8da8b3d7 (diff) |
spi: dw-mid: check that DMA was inited before exit
commit fb57862ead652454ceeb659617404c5f13bc34b5 upstream.
If the driver was compiled with DMA support, but DMA channels weren't acquired
by some reason, mid_spi_dma_exit() will crash the kernel.
Fixes: 7063c0d942a1 (spi/dw_spi: add DMA support)
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/spi/spi-dw-mid.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c index 48c170cd3e2..6192d7ad419 100644 --- a/drivers/spi/spi-dw-mid.c +++ b/drivers/spi/spi-dw-mid.c @@ -89,6 +89,8 @@ err_exit: static void mid_spi_dma_exit(struct dw_spi *dws) { + if (!dws->dma_inited) + return; dma_release_channel(dws->txchan); dma_release_channel(dws->rxchan); } |