mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval
@ 2026-10-28  2:59 shengjiu.wang
  2026-11-06  5:50 ` Chancel Liu
  2026-11-07 16:03 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: shengjiu.wang @ 2026-10-28  2:59 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	broonie, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

From: Shengjiu Wang <shengjiu.wang@nxp.com>

The original check used `if (!tmp_chan)`, which only catches NULL pointers.
However `asrc->get_dma_channel()` returns an error pointer. The NULL check
will always succeed, so replace it with `IS_ERR(tmp_chan)` to correctly
detect errors.

Fixes: b4136c0d69ea ("ASoC: fsl_asrc: check the second front-end DMA channel")
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
---
 sound/soc/fsl/fsl_asrc_dma.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
index b417de6abebe..b39d3d76d26a 100644
--- a/sound/soc/fsl/fsl_asrc_dma.c
+++ b/sound/soc/fsl/fsl_asrc_dma.c
@@ -251,7 +251,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
 
 		/* Get DMA request of Front-End */
 		tmp_chan = asrc->get_dma_channel(pair, dir);
-		if (!tmp_chan) {
+		if (IS_ERR(tmp_chan)) {
 			dma_release_channel(pair->dma_chan[!dir]);
 			pair->dma_chan[!dir] = NULL;
 			return -EINVAL;
-- 
2.34.1


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

* Re: [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval
  2026-10-28  2:59 [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval shengjiu.wang
@ 2026-11-06  5:50 ` Chancel Liu
  2026-11-07 16:00   ` Mark Brown
  2026-11-07 16:03 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Chancel Liu @ 2026-11-06  5:50 UTC (permalink / raw)
  To: shengjiu.wang, shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka,
	lgirdwood, broonie, perex, tiwai, linux-sound, linuxppc-dev,
	linux-kernel

On 10/28/2026 10:59 AM, shengjiu.wang@oss.nxp.com wrote:
> From: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> The original check used `if (!tmp_chan)`, which only catches NULL pointers.
> However `asrc->get_dma_channel()` returns an error pointer. The NULL check
> will always succeed, so replace it with `IS_ERR(tmp_chan)` to correctly
> detect errors.
> 
> Fixes: b4136c0d69ea ("ASoC: fsl_asrc: check the second front-end DMA channel")
> Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>

Reviewed-by: Chancel Liu <chancel.liu@gmail.com>

Regards,
Chancel Liu

> ---
>  sound/soc/fsl/fsl_asrc_dma.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/soc/fsl/fsl_asrc_dma.c b/sound/soc/fsl/fsl_asrc_dma.c
> index b417de6abebe..b39d3d76d26a 100644
> --- a/sound/soc/fsl/fsl_asrc_dma.c
> +++ b/sound/soc/fsl/fsl_asrc_dma.c
> @@ -251,7 +251,7 @@ static int fsl_asrc_dma_hw_params(struct snd_soc_component *component,
>  
>  		/* Get DMA request of Front-End */
>  		tmp_chan = asrc->get_dma_channel(pair, dir);
> -		if (!tmp_chan) {
> +		if (IS_ERR(tmp_chan)) {
>  			dma_release_channel(pair->dma_chan[!dir]);
>  			pair->dma_chan[!dir] = NULL;
>  			return -EINVAL;

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

* Re: [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval
  2026-11-06  5:50 ` Chancel Liu
@ 2026-11-07 16:00   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-11-07 16:00 UTC (permalink / raw)
  To: Chancel Liu
  Cc: shengjiu.wang, shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka,
	lgirdwood, perex, tiwai, linux-sound, linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 759 bytes --]

On Fri, Nov 06, 2026 at 01:50:46PM +0800, Chancel Liu wrote:
> On 10/28/2026 10:59 AM, shengjiu.wang@oss.nxp.com wrote:
> > From: Shengjiu Wang <shengjiu.wang@nxp.com>
> > 
> > The original check used `if (!tmp_chan)`, which only catches NULL pointers.
> > However `asrc->get_dma_channel()` returns an error pointer. The NULL check
> > will always succeed, so replace it with `IS_ERR(tmp_chan)` to correctly
> > detect errors.
> > 
> > Fixes: b4136c0d69ea ("ASoC: fsl_asrc: check the second front-end DMA channel")
> > Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
> 
> Reviewed-by: Chancel Liu <chancel.liu@gmail.com>

Note that if you send from an address other than the one you're using
for your R-b it'll be ignored by the tooling.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval
  2026-10-28  2:59 [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval shengjiu.wang
  2026-11-06  5:50 ` Chancel Liu
@ 2026-11-07 16:03 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2026-11-07 16:03 UTC (permalink / raw)
  To: shengjiu.wang, Xiubo.Lee, festevam, nicoleotsuka, lgirdwood,
	perex, tiwai, linux-sound, linuxppc-dev, linux-kernel,
	shengjiu.wang

On Wed, 28 Oct 2026 10:59:21 +0800, shengjiu.wang@oss.nxp.com wrote:
> ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-7.5

Thanks!

[1/1] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval
      https://git.kernel.org/broonie/sound/c/1f18d4babdf4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2026-11-08 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-28  2:59 [PATCH] ASoC: fsl_asrc_dma: fix error handling for DMA channel retrieval shengjiu.wang
2026-11-06  5:50 ` Chancel Liu
2026-11-07 16:00   ` Mark Brown
2026-11-07 16:03 ` Mark Brown

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®