All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: pcm_dmaengine: correct the error handler of dmaengine_prep_dma_cyclic
@ 2014-12-25  4:41 Barry Song
  2014-12-25  9:02 ` Lars-Peter Clausen
  0 siblings, 1 reply; 6+ messages in thread
From: Barry Song @ 2014-12-25  4:41 UTC (permalink / raw)
  To: peter.ujfalusi, lars, tiwai, broonie
  Cc: alsa-devel, workgroup.linux, Barry Song

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;
-- 
2.2.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-12-25  9:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-25  4:41 [PATCH] ALSA: pcm_dmaengine: correct the error handler of dmaengine_prep_dma_cyclic Barry Song
2014-12-25  9:02 ` Lars-Peter Clausen
2014-12-25  9:08   ` Barry Song
2014-12-25  9:35     ` Barry Song
2014-12-25  9:45     ` Lars-Peter Clausen
2014-12-25  9:53       ` Barry Song

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.