summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-19 20:33:20 +0100
committerMark Brown <broonie@linaro.org>2013-08-20 10:36:00 +0100
commit37e6071787908fa9009cbd002c86402720becc5f (patch)
tree10082805613bcd8da23d2a242e6dcdf7edf0cfa5
parent6418365688844125441d8df19fa65ebe2a49af53 (diff)
downloadop-kernel-dev-37e6071787908fa9009cbd002c86402720becc5f.zip
op-kernel-dev-37e6071787908fa9009cbd002c86402720becc5f.tar.gz
ASoC: samsung: Check to see if we managed to allocate a channel
Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Sangbeom Kim <sbkim73@samsung.com>
-rw-r--r--sound/soc/samsung/dma.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index 21b7926..50c1eb6 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);
}
OpenPOWER on IntegriCloud