Skip to contentSkip to conversation

spi_dw_midpci: fix oops during modprobe -r

PATCH New Andy Shevchenko 1 participant 1 message Aug 23, 2012 SPI

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi_dw_midpci: fix oops during modprobe -r

In case there were no DMA channel requested the modprobe -r spi_dw_midpci is going to crash. This patch fixes an issue.

---
 drivers/spi/spi-dw-mid.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/spi/spi-dw-mid.c +4 -2
index b9f0192..4fac682 100644
@@ -89,8 +89,10 @@ err_exit:
 
 static void mid_spi_dma_exit(struct dw_spi *dws)
 {
-	dma_release_channel(dws->txchan);
-	dma_release_channel(dws->rxchan);
+	if (dws->dma_inited) {
+		dma_release_channel(dws->txchan);
+		dma_release_channel(dws->rxchan);
+	}
 }
 
 /*
Signature · 9 lines
1.7.10.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/