From: Mark Brown Date: Mon, 19 Aug 2013 19:33:20 +0000 (+0100) Subject: ASoC: samsung: Check to see if we managed to allocate a channel X-Git-Tag: next-20130822~64^2~23^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=37e6071787908fa9009cbd002c86402720becc5f;p=karo-tx-linux.git ASoC: samsung: Check to see if we managed to allocate a channel Signed-off-by: Mark Brown Acked-by: Sangbeom Kim --- 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); }