Commit 21957b5b authored by Dan Carpenter's avatar Dan Carpenter Committed by Mark Brown

ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new()

The dma_mapping_error() returns true or false, but we want to return
-ENOMEM if there was an error.

Fixes: e9813122 ("ASoC: uniphier: add support for UniPhier AIO compress audio")
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Tested-by: default avatarKatsuhiro Suzuki <suzuki.katsuhiro@socionext.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 2b5803b9
...@@ -54,12 +54,11 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd) ...@@ -54,12 +54,11 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd)
dma_dir = DMA_TO_DEVICE; dma_dir = DMA_TO_DEVICE;
sub->compr_addr = dma_map_single(dev, sub->compr_area, size, dma_dir); sub->compr_addr = dma_map_single(dev, sub->compr_area, size, dma_dir);
ret = dma_mapping_error(dev, sub->compr_addr); if (dma_mapping_error(dev, sub->compr_addr)) {
if (ret) {
kfree(sub->compr_area); kfree(sub->compr_area);
sub->compr_area = NULL; sub->compr_area = NULL;
return ret; return -ENOMEM;
} }
sub->compr_bytes = size; sub->compr_bytes = size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment