dmaengine: tegra: Fix memory leak in terminate_all()

[ Upstream commit a7a7ee6f5a ]

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: ee17028009 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Akhil R 2023-01-18 17:28:01 +05:30 committed by Greg Kroah-Hartman
parent f7a57ef457
commit 567128076d
1 changed files with 1 additions and 0 deletions

View File

@ -707,6 +707,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;
}