summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dw
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2016-03-18 16:24:54 +0200
committerVinod Koul <vinod.koul@intel.com>2016-04-13 21:36:16 +0530
commit925a7d045e6f0129bc58ccd4c3a8dcef62486345 (patch)
treeab275ecdc781f0902ca110aff28b27174d582c20 /drivers/dma/dw
parentb68fd0976286e0cc4e163a83b8b68d6efca814dd (diff)
downloadlinux-0-day-925a7d045e6f0129bc58ccd4c3a8dcef62486345.tar.gz
linux-0-day-925a7d045e6f0129bc58ccd4c3a8dcef62486345.tar.xz
dmaengine: dw: set cdesc to NULL when free cyclic transfers
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: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dw')
-rw-r--r--drivers/dma/dw/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c
index a6d96f32f4f92..dd47d4b8aad65 100644
--- a/drivers/dma/dw/core.c
+++ b/drivers/dma/dw/core.c
@@ -1522,6 +1522,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);