Skip to content

Commit

Permalink
dmaengine: moxart-dma: Fix memory leak when stopping a running transfer
Browse files Browse the repository at this point in the history
The vd->node is removed from the lists when the transfer started so the
vchan_get_all_descriptors() will not find it. This results memory leak.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed Mar 30, 2015
1 parent f931782 commit fbef403
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/dma/moxart-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,10 @@ static int moxart_terminate_all(struct dma_chan *chan)

spin_lock_irqsave(&ch->vc.lock, flags);

if (ch->desc)
if (ch->desc) {
moxart_dma_desc_free(&ch->desc->vd);
ch->desc = NULL;
}

ctrl = readl(ch->base + REG_OFF_CTRL);
ctrl &= ~(APB_DMA_ENABLE | APB_DMA_FIN_INT_EN | APB_DMA_ERR_INT_EN);
Expand Down

0 comments on commit fbef403

Please sign in to comment.