Sfoglia il codice sorgente

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>
Andy Shevchenko 11 anni fa
parent
commit
fb57862ead
1 ha cambiato i file con 2 aggiunte e 0 eliminazioni
  1. 2 0
      drivers/spi/spi-dw-mid.c

+ 2 - 0
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);
 }