From 37e6071787908fa9009cbd002c86402720becc5f Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 19 Aug 2013 20:33:20 +0100 Subject: ASoC: samsung: Check to see if we managed to allocate a channel Signed-off-by: Mark Brown Acked-by: Sangbeom Kim --- sound/soc/samsung/dma.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sound/soc/samsung') diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c index 21b79262010e..50c1eb669e90 100644 --- a/sound/soc/samsung/dma.c +++ b/sound/soc/samsung/dma.c @@ -176,6 +176,10 @@ static int dma_hw_params(struct snd_pcm_substream *substream, prtd->params->ch = prtd->params->ops->request( prtd->params->channel, &req, rtd->cpu_dai->dev, prtd->params->ch_name); + if (!prtd->params->ch) { + pr_err("Failed to allocate DMA channel\n"); + return -ENXIO; + } prtd->params->ops->config(prtd->params->ch, &config); } -- cgit v1.2.3-58-ga151