All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Andy Shevchenko" <andriy.shevchenko@linux.intel.com>
Cc: vkoul@kernel.org, Frank.Li@kernel.org, dmaengine@vger.kernel.org
Subject: Re: [PATCH v2 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()
Date: Fri, 18 Sep 2026 11:52:29 +0000	[thread overview]
Message-ID: <20260918115229.CC8AC1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260918113727.1898998-3-andriy.shevchenko@linux.intel.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] sprd: leak of -EPROBE_DEFER to userspace in ioctl paths
--

commit 27b9b3ffed70e1a1411a3993c1e469b1c18205a6
Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan()

This commit replaces the deprecated dma_request_slave_channel() function
with dma_request_chan() in the Spreadtrum ALSA SoC driver. It also updates
the error handling to propagate all possible errors returned by the new
function back to the caller.

> diff --git a/sound/soc/sprd/sprd-pcm-compress.c b/sound/soc/sprd/sprd-pcm-compress.c
> index e5249924b54d9..f394121d417a3 100644
> --- a/sound/soc/sprd/sprd-pcm-compress.c
> +++ b/sound/soc/sprd/sprd-pcm-compress.c
[ ... ]
> @@ -153,12 +154,12 @@ static int sprd_platform_compr_dma_config(struct snd_soc_component *component,
>  		return -EINVAL;
>  	}
>  
> -	dma->chan = dma_request_slave_channel(dev,
> -					      dma_params->chan_name[channel]);
> -	if (!dma->chan) {
> +	chan = dma_request_chan(dev, dma_params->chan_name[channel]);
> +	if (IS_ERR(chan)) {
>  		dev_err(dev, "failed to request dma channel\n");
> -		return -ENODEV;
> +		return PTR_ERR(chan);

[Severity: Medium]
Since sprd_platform_compr_dma_config() is called during the ALSA
SNDRV_COMPRESS_SET_PARAMS ioctl path, could this propagate -EPROBE_DEFER
directly to userspace if dma_request_chan() defers probing? Returning
internal kernel errors like -EPROBE_DEFER to userspace can confuse user
applications as it violates UAPI error semantics.

>  	}
> +	dma->chan = chan;
>  
>  	sgt = sg = kzalloc_objs(*sg, sg_num);
>  	if (!sg) {
> diff --git a/sound/soc/sprd/sprd-pcm-dma.c b/sound/soc/sprd/sprd-pcm-dma.c
> index 2d5ffbe17e814..2a89dc7616bf7 100644
> --- a/sound/soc/sprd/sprd-pcm-dma.c
> +++ b/sound/soc/sprd/sprd-pcm-dma.c
[ ... ]
> @@ -170,15 +170,16 @@ static int sprd_pcm_request_dma_channel(struct snd_soc_component *component,
>  
>  	for (i = 0; i < channels; i++) {
>  		struct sprd_pcm_dma_data *data = &dma_private->data[i];
> +		struct dma_chan *chan;
>  
> -		data->chan = dma_request_slave_channel(dev,
> -						       dma_params->chan_name[i]);
> -		if (!data->chan) {
> +		chan = dma_request_chan(dev, dma_params->chan_name[i]);
> +		if (IS_ERR(chan)) {
>  			dev_err(dev, "failed to request dma channel:%s\n",
>  				dma_params->chan_name[i]);
>  			sprd_pcm_release_dma_channel(substream);
> -			return -ENODEV;
> +			return PTR_ERR(chan);

[Severity: Medium]
Similarly, sprd_pcm_request_dma_channel() is invoked during the
SNDRV_PCM_IOCTL_HW_PARAMS ioctl path. Does returning PTR_ERR(chan) here also
risk leaking -EPROBE_DEFER to userspace if the DMA channel is not yet
available?

>  		}
> +		data->chan = chan;
>  	}
>  
>  	return 0;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260918113727.1898998-1-andriy.shevchenko@linux.intel.com?part=2

  reply	other threads:[~2026-09-18 11:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18 11:34 [PATCH v2 0/7] ASoC et alia: Convert to use dma_request_chan() Andy Shevchenko
2026-09-18 11:34 ` [PATCH v2 1/7] ASoC: stm32: spdifrx: Drop mention of the deprecated and unused call Andy Shevchenko
2026-09-18 11:34 ` [PATCH v2 2/7] ASoC: sprd: Replace dma_request_slave_channel() by dma_request_chan() Andy Shevchenko
2026-09-18 11:52   ` sashiko-bot [this message]
2026-09-18 11:34 ` [PATCH v2 3/7] ASoC: soc-generic-dmaengine-pcm: " Andy Shevchenko
2026-09-18 11:34 ` [PATCH v2 4/7] ASoC: pxa: " Andy Shevchenko
2026-09-18 11:34 ` [PATCH v2 5/7] ASoC: fsl_asrc: " Andy Shevchenko
2026-09-18 13:55   ` Frank Li
2026-09-18 11:34 ` [PATCH v2 6/7] gpib: fmh_gpib: " Andy Shevchenko
2026-09-18 12:09   ` sashiko-bot
2026-09-18 11:34 ` [PATCH v2 7/7] dmaengine: Remove deprecated dma_request_slave_channel() Andy Shevchenko
2026-09-18 17:58   ` Vinod Koul
2026-09-19 13:56     ` Andy Shevchenko
2026-09-21 12:01 ` [PATCH v2 0/7] ASoC et alia: Convert to use dma_request_chan() Mark Brown

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=20260918115229.CC8AC1F000FF@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=vkoul@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.