linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi_dw_midpci: fix oops during modprobe -r
@ 2012-08-23 11:25 Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2012-08-23 11:25 UTC (permalink / raw)
  To: Grant Likely, spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: Andy Shevchenko

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

Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
 drivers/spi/spi-dw-mid.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-dw-mid.c b/drivers/spi/spi-dw-mid.c
index b9f0192..4fac682 100644
--- a/drivers/spi/spi-dw-mid.c
+++ b/drivers/spi/spi-dw-mid.c
@@ -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);
+	}
 }
 
 /*
-- 
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/

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-08-23 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-23 11:25 [PATCH] spi_dw_midpci: fix oops during modprobe -r Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).