diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2017-11-05 20:07:27 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-11-06 06:29:44 -0500 |
commit | c409c2a963475f0288ba3bb47a10f04f6441ffb9 (patch) | |
tree | ed4a7643d0af85293058c11c1987aad889bdfe10 | |
parent | 9b6ea25066b05c4b8bc4ea69037741bd67649cd1 (diff) |
ASoC: rsnd: return -EIO if rsnd_dmaen_request_channel() failed
PTR_ERR(NULL) is success. Normally when a function returns both NULL
and error pointers, it means that NULL is not a error.
But, rsnd_dmaen_request_channel() returns NULL if requested resource
was failed.
Let's return -EIO if rsnd_dmaen_request_channel() was failed on
rsnd_dmaen_nolock_start().
This patch fixes commit edce5c496c6a ("ASoC: rsnd: Request/Release DMA
channel eachtime")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sh/rcar/dma.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c index 5bc9ec16813c..fd557abfe390 100644 --- a/sound/soc/sh/rcar/dma.c +++ b/sound/soc/sh/rcar/dma.c | |||
@@ -219,11 +219,9 @@ static int rsnd_dmaen_nolock_start(struct rsnd_mod *mod, | |||
219 | dma->mod_from, | 219 | dma->mod_from, |
220 | dma->mod_to); | 220 | dma->mod_to); |
221 | if (IS_ERR_OR_NULL(dmaen->chan)) { | 221 | if (IS_ERR_OR_NULL(dmaen->chan)) { |
222 | int ret = PTR_ERR(dmaen->chan); | ||
223 | |||
224 | dmaen->chan = NULL; | 222 | dmaen->chan = NULL; |
225 | dev_err(dev, "can't get dma channel\n"); | 223 | dev_err(dev, "can't get dma channel\n"); |
226 | return ret; | 224 | return -EIO; |
227 | } | 225 | } |
228 | 226 | ||
229 | return 0; | 227 | return 0; |