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 edce5c496c ("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>
This commit is contained in:
Kuninori Morimoto 2017-11-06 01:07:27 +00:00 committed by Mark Brown
parent 9b6ea25066
commit c409c2a963
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0

View file

@ -219,11 +219,9 @@ static int rsnd_dmaen_nolock_start(struct rsnd_mod *mod,
dma->mod_from,
dma->mod_to);
if (IS_ERR_OR_NULL(dmaen->chan)) {
int ret = PTR_ERR(dmaen->chan);
dmaen->chan = NULL;
dev_err(dev, "can't get dma channel\n");
return ret;
return -EIO;
}
return 0;