aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2014-09-12 08:11:58 -0400
committerMark Brown <broonie@kernel.org>2014-09-13 12:01:57 -0400
commitfb57862ead652454ceeb659617404c5f13bc34b5 (patch)
treefbb408839ae0cd552828a8b29fa5ec4cf625558a /drivers/spi
parent05ed2aee3e97c9cfb737388706b439264e27eb0c (diff)
spi: dw-mid: check that DMA was inited before exit
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>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spi-dw-mid.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index 6d207afec8cb..0d88e4aab73e 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -89,6 +89,8 @@ err_exit:
89 89
90static void mid_spi_dma_exit(struct dw_spi *dws) 90static void mid_spi_dma_exit(struct dw_spi *dws)
91{ 91{
92 if (!dws->dma_inited)
93 return;
92 dma_release_channel(dws->txchan); 94 dma_release_channel(dws->txchan);
93 dma_release_channel(dws->rxchan); 95 dma_release_channel(dws->rxchan);
94} 96}