]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: virt-dma: Fix access after free in vchan_complete()
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Fri, 20 Dec 2019 13:11:00 +0000 (15:11 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 23 Dec 2019 07:53:24 +0000 (13:23 +0530)
commit2f8c1cbe5a579ab194521e69961a130a42a28c26
treeefe576215c6ba64ea6239188b14c166dff8682e0
parent8dadf103b7a132e5a5f4a1de5a060ad0b3dfa860
dmaengine: virt-dma: Fix access after free in vchan_complete()

vchan_vdesc_fini() is freeing up 'vd' so the access to vd->tx_result is
via already freed up memory.

Move the vchan_vdesc_fini() after invoking the callback to avoid this.

Fixes: 143dcd6b2f7b8 ("dmaengine: virt-dma: store result on dma descriptor")
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20191220131100.21804-1-peter.ujfalusi@ti.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/virt-dma.c