From: Peter Ujfalusi Date: Fri, 27 Mar 2015 11:35:55 +0000 (+0200) Subject: dmaengine: moxart-dma: Fix memory leak when stopping a running transfer X-Git-Tag: Ubuntu-5.10.0-12.13~15089^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=fbef403aa7b377eb238dc6cade21213c315bc1a7;p=mirror_ubuntu-hirsute-kernel.git 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: Peter Ujfalusi Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/moxart-dma.c b/drivers/dma/moxart-dma.c index 15cab7d79525..b4634109e010 100644 --- a/drivers/dma/moxart-dma.c +++ b/drivers/dma/moxart-dma.c @@ -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);