mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v1 1/1] ASoC: sprd: Shadow errors from dma_request_chan()
@ 2026-09-24 16:48 Andy Shevchenko
  0 siblings, 0 replies; only message in thread
From: Andy Shevchenko @ 2026-09-24 16:48 UTC (permalink / raw)
  To: Andy Shevchenko, linux-sound, linux-kernel
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	Orson Zhai, Baolin Wang, Chunyan Zhang, Sashiko

For some reason the SPDR PCM support code requests DMA resources
in the IOCTL. This might lead to the Linux error codes, such as
EPROBE_DEFER, to be leaked to the user space. Prevent that from
happening by shadowing errors from dma_request_chan() as it was
done previously (see Fixes tag).

Fixes: 08d77e31df21 ("ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/20260918115229.CC8AC1F000FF@smtp.kernel.org
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 sound/soc/sprd/sprd-pcm-compress.c | 2 +-
 sound/soc/sprd/sprd-pcm-dma.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
index 0b110b72482c..d18c9a4e5a77 100644
--- a/sound/soc/sprd/sprd-pcm-compress.c
+++ b/sound/soc/sprd/sprd-pcm-compress.c
@@ -157,7 +157,7 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
 	chan = dma_request_chan(dev, dma_params->chan_name[channel]);
 	if (IS_ERR(chan)) {
 		dev_err(dev, "failed to request dma channel\n");
-		return PTR_ERR(chan);
+		return -ENODEV;
 	}
 	dma->chan = chan;
 
diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
index bc4d24e5a25d..fadaafbd807c 100644
--- a/sound/soc/sprd/sprd-pcm-dma.c
+++ b/sound/soc/sprd/sprd-pcm-dma.c
@@ -171,7 +171,7 @@ static int sprd_pcm_request_dma_channel(struct snd_soc_component *component,
 			dev_err(dev, "failed to request dma channel:%s\n",
 				dma_params->chan_name[i]);
 			sprd_pcm_release_dma_channel(substream);
-			return PTR_ERR(chan);
+			return -ENODEV;
 		}
 		data->chan = chan;
 	}
-- 
2.50.1


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-24 16:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-24 16:48 [PATCH v1 1/1] ASoC: sprd: Shadow errors from dma_request_chan() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®