diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-03-27 07:35:55 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-03-30 13:47:08 -0400 |
commit | fbef403aa7b377eb238dc6cade21213c315bc1a7 (patch) | |
tree | 80d3f80d753c71f9f583a5e2d5a8c1456c7dfc4b | |
parent | f93178291712772983845700b12fc1c8b32f2eb1 (diff) |
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 <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r-- | drivers/dma/moxart-dma.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) | |||
193 | 193 | ||
194 | spin_lock_irqsave(&ch->vc.lock, flags); | 194 | spin_lock_irqsave(&ch->vc.lock, flags); |
195 | 195 | ||
196 | if (ch->desc) | 196 | if (ch->desc) { |
197 | moxart_dma_desc_free(&ch->desc->vd); | ||
197 | ch->desc = NULL; | 198 | ch->desc = NULL; |
199 | } | ||
198 | 200 | ||
199 | ctrl = readl(ch->base + REG_OFF_CTRL); | 201 | ctrl = readl(ch->base + REG_OFF_CTRL); |
200 | ctrl &= ~(APB_DMA_ENABLE | APB_DMA_FIN_INT_EN | APB_DMA_ERR_INT_EN); | 202 | ctrl &= ~(APB_DMA_ENABLE | APB_DMA_FIN_INT_EN | APB_DMA_ERR_INT_EN); |