]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
dmaengine: dw: set cdesc to NULL when free cyclic transfers
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 18 Mar 2016 14:24:54 +0000 (16:24 +0200)
committerVinod Koul <vinod.koul@intel.com>
Wed, 13 Apr 2016 16:06:16 +0000 (21:36 +0530)
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>
drivers/dma/dw/core.c

index a6d96f32f4f928fa877f77fe4835883c182bf334..dd47d4b8aad650c8b65dc90def84fed30308e8cd 100644 (file)
@@ -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);