[alsa-devel] [PATCH] ALSA: pcm_dmaengine: correct the error handler of dmaengine_prep_dma_cyclic

Barry Song 21cnbao at gmail.com
Thu Dec 25 05:41:15 CET 2014


From: Barry Song <Baohua.Song at csr.com>

preparing cyclic DMA description can fail either due to DMA desc list
is full(-ENOMEM), or due to the coming DMA configuration is illegal or
not supported by the acting DMA hardware(other ERR codes).

Signed-off-by: Barry Song <Baohua.Song at csr.com>
---
 sound/core/pcm_dmaengine.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/core/pcm_dmaengine.c b/sound/core/pcm_dmaengine.c
index 6542c40..5cac7e4 100644
--- a/sound/core/pcm_dmaengine.c
+++ b/sound/core/pcm_dmaengine.c
@@ -163,6 +163,8 @@ static int dmaengine_pcm_prepare_and_submit(struct snd_pcm_substream *substream)
 
 	if (!desc)
 		return -ENOMEM;
+	if (IS_ERR(desc))
+		return PTR_ERR(desc);
 
 	desc->callback = dmaengine_pcm_dma_complete;
 	desc->callback_param = substream;
-- 
2.2.0



More information about the Alsa-devel mailing list