Skip to content
Snippets Groups Projects
user avatar
Paul Cercueil authored
The jz4780_dma_tx_status() function would check if a channel's cookie
state was set to 'completed', and if not, it would enter the critical
section. However, in that time frame, the jz4780_dma_chan_irq() function
was able to set the cookie to 'completed', and clear the jzchan->vchan
pointer, which was deferenced in the critical section of the first
function.

Fix this race by checking the channel's cookie state after entering the
critical function and not before.

Fixes: d894fc60 ("dmaengine: jz4780: add driver for the Ingenic JZ4780 DMA controller")
Cc: stable@vger.kernel.org # v4.0
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Reported-by: default avatarArtur Rojek <contact@artur-rojek.eu>
Tested-by: default avatarArtur Rojek <contact@artur-rojek.eu>
Link: https://lore.kernel.org/r/20201004140307.885556-1-paul@crapouillou.net


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
baf6fd97
History
Name Last commit Last update