Skip to content

Commit

Permalink
dmaengine: tegra: Fix memory leak in terminate_all()
Browse files Browse the repository at this point in the history
[ Upstream commit a7a7ee6 ]

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: ee17028 ("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>
  • Loading branch information
Akhil R authored and gregkh committed Feb 1, 2023
1 parent f7a57ef commit 5671280
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/dma/tegra186-gpc-dma.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5671280

Please sign in to comment.