Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fbef403a authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Vinod Koul
Browse files

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: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent f9317829
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);