mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-09 12:24:07 -05:00
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: e98131222f ("ASoC: uniphier: add support for UniPhier AIO compress audio")
Signed-off-by: Dan Carpenter <[email protected]>
Tested-by: Katsuhiro Suzuki <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
parent
2b5803b959
commit
21957b5bf0
1 changed files with 2 additions and 3 deletions
|
|
@ -54,12 +54,11 @@ static int uniphier_aio_comprdma_new(struct snd_soc_pcm_runtime *rtd)
|
|||
dma_dir = DMA_TO_DEVICE;
|
||||
|
||||
sub->compr_addr = dma_map_single(dev, sub->compr_area, size, dma_dir);
|
||||
ret = dma_mapping_error(dev, sub->compr_addr);
|
||||
if (ret) {
|
||||
if (dma_mapping_error(dev, sub->compr_addr)) {
|
||||
kfree(sub->compr_area);
|
||||
sub->compr_area = NULL;
|
||||
|
||||
return ret;
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
sub->compr_bytes = size;
|
||||
|
|
|
|||
Loading…
Reference in a new issue