From: Barry Song Baohua.Song@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@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;