mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
dmaengine: hsu: Fix memory leak when stopping a running transfer
The vd->node is removed from the lists when the transfer started so the vchan_get_all_descriptors() will not find it. This results memory leak. Signed-off-by: Peter Ujfalusi <[email protected]> [andy: fix the typo to prevent a compilation error] Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
This commit is contained in:
parent
81cc6edc08
commit
429770823d
1 changed files with 4 additions and 1 deletions
|
|
@ -384,7 +384,10 @@ static int hsu_dma_terminate_all(struct dma_chan *chan)
|
|||
spin_lock_irqsave(&hsuc->vchan.lock, flags);
|
||||
|
||||
hsu_dma_stop_channel(hsuc);
|
||||
hsuc->desc = NULL;
|
||||
if (hsuc->desc) {
|
||||
hsu_dma_desc_free(&hsuc->desc->vdesc);
|
||||
hsuc->desc = NULL;
|
||||
}
|
||||
|
||||
vchan_get_all_descriptors(&hsuc->vchan, &head);
|
||||
spin_unlock_irqrestore(&hsuc->vchan.lock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue