提交 fbef403a 编写于 作者: P Peter Ujfalusi 提交者: Vinod Koul

dmaengine: moxart-dma: Fix memory leak when stopping a running transfer

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: NPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: NVinod Koul <vinod.koul@intel.com>
上级 f9317829
...@@ -193,8 +193,10 @@ static int moxart_terminate_all(struct dma_chan *chan) ...@@ -193,8 +193,10 @@ static int moxart_terminate_all(struct dma_chan *chan)
spin_lock_irqsave(&ch->vc.lock, flags); spin_lock_irqsave(&ch->vc.lock, flags);
if (ch->desc) if (ch->desc) {
moxart_dma_desc_free(&ch->desc->vd);
ch->desc = NULL; ch->desc = NULL;
}
ctrl = readl(ch->base + REG_OFF_CTRL); ctrl = readl(ch->base + REG_OFF_CTRL);
ctrl &= ~(APB_DMA_ENABLE | APB_DMA_FIN_INT_EN | APB_DMA_ERR_INT_EN); ctrl &= ~(APB_DMA_ENABLE | APB_DMA_FIN_INT_EN | APB_DMA_ERR_INT_EN);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册