diff mbox

[15/15] dmaengine: dw: set cdesc to NULL when free cyclic transfers

Message ID 1453663322-14474-16-git-send-email-mans@mansr.com (mailing list archive)
State Changes Requested
Headers show

Commit Message

Måns Rullgård Jan. 24, 2016, 7:22 p.m. UTC
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

To be sure we have the cyclic transfers already gone we set cdesc to NULL. It
will prevent the double free.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Mans Rullgard <mans@mansr.com>
---
 drivers/dma/dw/core.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index b6634adf24f9..5606deb7f060 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1480,6 +1480,8 @@  void dw_dma_cyclic_free(struct dma_chan *chan)
 	kfree(cdesc->desc);
 	kfree(cdesc);
 
+	dwc->cdesc = NULL;
+
 	clear_bit(DW_DMA_IS_CYCLIC, &dwc->flags);
 }
 EXPORT_SYMBOL(dw_dma_cyclic_free);