[PATCH] ASoC: samsung: Check to see if we managed to allocate a channel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Mark Brown <broonie@xxxxxxxxxx>

Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
---
 sound/soc/samsung/dma.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/sound/soc/samsung/dma.c b/sound/soc/samsung/dma.c
index 6e2b2b4..d54df85 100644
--- a/sound/soc/samsung/dma.c
+++ b/sound/soc/samsung/dma.c
@@ -183,6 +183,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);
 	}
 
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux