From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>, Orson Zhai <orsonzhai@gmail.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Chunyan Zhang <zhang.lyra@gmail.com>,
Sashiko <sashiko-bot@kernel.org>
Subject: [PATCH v1 1/1] ASoC: sprd: Shadow errors from dma_request_chan()
Date: Thu, 24 Sep 2026 18:48:12 +0200 [thread overview]
Message-ID: <20260924164812.816743-1-andriy.shevchenko@linux.intel.com> (raw)
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
reply other threads:[~2026-09-24 16:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260924164812.816743-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=broonie@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=perex@perex.cz \
--cc=sashiko-bot@kernel.org \
--cc=tiwai@suse.com \
--cc=zhang.lyra@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®