]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: xilinx_dma: Add missing check for empty list
authorSebastian von Ohr <vonohr@smaract.com>
Tue, 3 Mar 2020 13:05:18 +0000 (14:05 +0100)
committerVinod Koul <vkoul@kernel.org>
Wed, 15 Apr 2020 16:12:11 +0000 (21:42 +0530)
commit3214f5a28e6f7e0cb22c7d8a088a2fa09e0c7a94
tree96e729dae0ec64fd5aa4dfff5de6f9975ed9c7ad
parentf9083bd46a84afa996ade67984b325d60fe7cd60
dmaengine: xilinx_dma: Add missing check for empty list

The DMA transfer might finish just after checking the state with
dma_cookie_status, but before the lock is acquired. Not checking
for an empty list in xilinx_dma_tx_status may result in reading
random data or data corruption when desc is written to. This can
be reliably triggered by using dma_sync_wait to wait for DMA
completion.

Signed-off-by: Sebastian von Ohr <vonohr@smaract.com>
Tested-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/20200303130518.333-1-vonohr@smaract.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/xilinx/xilinx_dma.c