summaryrefslogtreecommitdiffstats
path: root/drivers/dma/tegra20-apb-dma.c
diff options
context:
space:
mode:
authorDmitry Osipenko <digetx@gmail.com>2020-02-09 19:33:41 +0300
committerVinod Koul <vkoul@kernel.org>2020-02-25 11:57:33 +0530
commit8e84172e372bdca20c305d92d51d33640d2da431 (patch)
tree317f912be4d5f32db31b794d1e312ab67d2e6782 /drivers/dma/tegra20-apb-dma.c
parentdda5e35a771043bb5a9e6107fa9f141d8d56b847 (diff)
downloadlinux-8e84172e372bdca20c305d92d51d33640d2da431.tar.bz2
dmaengine: tegra-apb: Prevent race conditions on channel's freeing
It's incorrect to check the channel's "busy" state without taking a lock. That shouldn't cause any real troubles, nevertheless it's always better not to have any race conditions in the code. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Acked-by: Jon Hunter <jonathanh@nvidia.com> Link: https://lore.kernel.org/r/20200209163356.6439-5-digetx@gmail.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/dma/tegra20-apb-dma.c')
-rw-r--r--drivers/dma/tegra20-apb-dma.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c
index b18cbfbab004..81a2b5f4181f 100644
--- a/drivers/dma/tegra20-apb-dma.c
+++ b/drivers/dma/tegra20-apb-dma.c
@@ -1298,8 +1298,7 @@ static void tegra_dma_free_chan_resources(struct dma_chan *dc)
dev_dbg(tdc2dev(tdc), "Freeing channel %d\n", tdc->id);
- if (tdc->busy)
- tegra_dma_terminate_all(dc);
+ tegra_dma_terminate_all(dc);
spin_lock_irqsave(&tdc->lock, flags);
list_splice_init(&tdc->pending_sg_req, &sg_req_list);