diff options
author | Akhil R <akhilrajeev@nvidia.com> | 2023-01-18 17:28:01 +0530 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2023-01-18 22:18:38 +0530 |
commit | a7a7ee6f5a019ad72852c001abbce50d35e992f2 (patch) | |
tree | 016fe18e4292701170367f62370b90f8c9fb36b2 /drivers/dma/tegra186-gpc-dma.c | |
parent | 596b53ccc36a546ab28e8897315c5b4d1d5a0200 (diff) |
dmaengine: tegra: Fix memory leak in terminate_all()
Terminate vdesc when terminating an ongoing transfer.
This will ensure that the vdesc is present in the desc_terminated list
The descriptor will be freed later in desc_free_list().
This fixes the memory leaks which can happen when terminating an
ongoing transfer.
Fixes: ee17028009d4 ("dmaengine: tegra: Add tegra gpcdma driver")
Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Link: https://lore.kernel.org/r/20230118115801.15210-1-akhilrajeev@nvidia.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/tegra186-gpc-dma.c')
-rw-r--r-- | drivers/dma/tegra186-gpc-dma.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/tegra186-gpc-dma.c b/drivers/dma/tegra186-gpc-dma.c index 1d1180db6d4e..8f67f453a492 100644 --- a/drivers/dma/tegra186-gpc-dma.c +++ b/drivers/dma/tegra186-gpc-dma.c @@ -711,6 +711,7 @@ static int tegra_dma_terminate_all(struct dma_chan *dc) return err; } + vchan_terminate_vdesc(&tdc->dma_desc->vd); tegra_dma_disable(tdc); tdc->dma_desc = NULL; } |