summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f85397d)
raw | patch | inline | side by side (parent: f85397d)
author | Lars-Peter Clausen <lars@metafoo.de> | |
Fri, 4 Nov 2016 22:45:37 +0000 (22:45 +0000) | ||
committer | Jean-Jacques Hiblot <jjhiblot@ti.com> | |
Wed, 7 Dec 2016 14:46:13 +0000 (15:46 +0100) |
commit bc0e7345168c0f7483d2d1da86285d89136417cd upstream
Use the new dmaengine_synchronize() function to make sure that all complete
callbacks have finished running before the runtime data, which is accessed
in the completed callback, is freed.
This fixes a long standing use-after-free race condition that has been
observed on some systems.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Conflicts:
sound/core/pcm_dmaengine.c
Use the new dmaengine_synchronize() function to make sure that all complete
callbacks have finished running before the runtime data, which is accessed
in the completed callback, is freed.
This fixes a long standing use-after-free race condition that has been
observed on some systems.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Conflicts:
sound/core/pcm_dmaengine.c
sound/core/pcm_dmaengine.c | patch | blob | history |
index 3c72ed414cfce8d0cdad68d224737b7917e9c257..70ad995dff6a0aa671703a56a819d0a93e61c8f4 100644 (file)
dmaengine_pause(prtd->dma_chan);
break;
case SNDRV_PCM_TRIGGER_STOP:
- dmaengine_terminate_all(prtd->dma_chan);
+ dmaengine_terminate_async(prtd->dma_chan);
break;
default:
return -EINVAL;
{
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
+ dmaengine_synchronize(prtd->dma_chan);
kfree(prtd);
return 0;
{
struct dmaengine_pcm_runtime_data *prtd = substream_to_prtd(substream);
+ dmaengine_synchronize(prtd->dma_chan);
dma_release_channel(prtd->dma_chan);
+ kfree(prtd);
- return snd_dmaengine_pcm_close(substream);
+ return 0;
}
EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_close_release_chan);