Skip to contentSkip to conversation

ASoC: Tegra: Fix error handling in DMA channel alloc

PATCH Applied Stephen Warren 3 participants 3 messages Feb 23, 2011 – Feb 28, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Tegra: Fix error handling in DMA channel alloc

tegra_dma_allocate_channel() returns NULL on errors, not an error pointer.

---
 sound/soc/tegra/tegra_pcm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/tegra/tegra_pcm.c +2 -2
index 40540b1..3c271f9 100644
@@ -161,8 +161,8 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
 	prtd->dma_req[1].dev = prtd;
 
 	prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
-	if (IS_ERR(prtd->dma_chan)) {
-		ret = PTR_ERR(prtd->dma_chan);
+	if (prtd->dma_chan == NULL) {
+		ret = -ENOMEM;
 		goto err;
 	}
 
Signature · 1 line
1.7.1
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Stephen Warren

tegra_dma_allocate_channel() returns NULL on errors, not an error pointer.

---
 sound/soc/tegra/tegra_pcm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/tegra/tegra_pcm.c +0 -0
index 40540b1..3c271f9 100644

sound/soc/tegra/tegra_pcm.c static int tegra_pcm_open(struct snd_pcm_substream *substream) · line 168

Quoted 10 lines
sound/soc/tegra/tegra_pcm.c +2 -2
@@ -161,8 +161,8 @@ static int tegra_pcm_open(struct snd_pcm_substream *substream)
 	prtd->dma_req[1].dev = prtd;
 
 	prtd->dma_chan = tegra_dma_allocate_channel(TEGRA_DMA_MODE_ONESHOT);
-	if (IS_ERR(prtd->dma_chan)) {
-		ret = PTR_ERR(prtd->dma_chan);
+	if (prtd->dma_chan == NULL) {
+		ret = -ENOMEM;
 		goto err;
 	}