alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new()
@ 2018-02-14  7:15 Dan Carpenter
  2018-02-14 10:37 ` [alsa-devel] " Katsuhiro Suzuki
  2018-02-14 13:29 ` Applied "ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new()" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-02-14  7:15 UTC (permalink / raw)
  To: Katsuhiro Suzuki
  Cc: alsa-devel, kernel-janitors, Takashi Iwai, Liam Girdwood,
	Masahiro Yamada, Mark Brown

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

Fixes: e98131222ff9 ("ASoC: uniphier: add support for UniPhier AIO compress audio")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/sound/soc/uniphier/aio-compress.c b/sound/soc/uniphier/aio-compress.c
index 7f7abe3ae99d..4751c8bdabec 100644
--- a/sound/soc/uniphier/aio-compress.c
+++ b/sound/soc/uniphier/aio-compress.c
@@ -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;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-14 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14  7:15 [PATCH] ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new() Dan Carpenter
2018-02-14 10:37 ` [alsa-devel] " Katsuhiro Suzuki
2018-02-14 13:29 ` Applied "ASoC: uniphier: fix an error code in uniphier_aio_comprdma_new()" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).