Commit 4a60fd94 authored by Jeffrey Hugo's avatar Jeffrey Hugo Committed by Ben Hutchings
Browse files

dmaengine: qcom: bam_dma: Fix resource leak



commit 76678193 upstream.

bam_dma_terminate_all() will leak resources if any of the transactions are
committed to the hardware (present in the desc fifo), and not complete.
Since bam_dma_terminate_all() does not cause the hardware to be updated,
the hardware will still operate on any previously committed transactions.
This can cause memory corruption if the memory for the transaction has been
reassigned, and will cause a sync issue between the BAM and its client(s).

Fix this by properly updating the hardware in bam_dma_terminate_all().

Fixes: e7c0fe2a ("dmaengine: add Qualcomm BAM dma driver")
Signed-off-by: default avatarJeffrey Hugo <jeffrey.l.hugo@gmail.com>
Link: https://lore.kernel.org/r/20191017152606.34120-1-jeffrey.l.hugo@gmail.com


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
[Jeffrey Hugo: Backported to 4.4 which is lacking 6b4faeac
 ("dmaengine: qcom-bam: Process multiple pending descriptors")]
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent b1659d0b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment