diff options
author | Peter Ujfalusi <peter.ujfalusi@ti.com> | 2015-05-26 13:11:28 +0300 |
---|---|---|
committer | Vinod Koul <vinod.koul@intel.com> | 2015-06-02 18:33:08 +0530 |
commit | 429770823d961187c39df490d49683c467b10065 (patch) | |
tree | 1b64e2ad6ce073b73c31faed43653151cd0584cd /drivers/dma/hsu | |
parent | 81cc6edc08705ac0146fe6ac14a0982a31ce6f3d (diff) | |
download | linux-stable-429770823d961187c39df490d49683c467b10065.tar.gz linux-stable-429770823d961187c39df490d49683c467b10065.tar.bz2 linux-stable-429770823d961187c39df490d49683c467b10065.zip |
dmaengine: hsu: 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>
[andy: fix the typo to prevent a compilation error]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/hsu')
-rw-r--r-- | drivers/dma/hsu/hsu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index 9b84def7a353..f42f71e37e73 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -384,7 +384,10 @@ static int hsu_dma_terminate_all(struct dma_chan *chan) spin_lock_irqsave(&hsuc->vchan.lock, flags); hsu_dma_stop_channel(hsuc); - hsuc->desc = NULL; + if (hsuc->desc) { + hsu_dma_desc_free(&hsuc->desc->vdesc); + hsuc->desc = NULL; + } vchan_get_all_descriptors(&hsuc->vchan, &head); spin_unlock_irqrestore(&hsuc->vchan.lock, flags); |