Re: [PATCH] ASoC: fsl_asrc: check the second front-end DMA channel

From: Slavin Liu

Date: Sat Sep 26 2026 - 10:11:08 EST


Hi Dan,

On Sat, Sep 26, 2026 at 04:19:38PM +0300, Dan Carpenter wrote:
> The ->get_dma_channel() function pointer returns error pointers not
> NULL.
>
> sound/soc/fsl/fsl_asrc_dma.c:254 fsl_asrc_dma_hw_params()
> warn: 'tmp_chan' is an error pointer or valid
>
> sound/soc/fsl/fsl_easrc.c | (struct fsl_asrc)->get_dma_channel | fsl_easrc_get_dma_channel | 1
> sound/soc/fsl/fsl_asrc.c | (struct fsl_asrc)->get_dma_channel | fsl_asrc_get_dma_channel | 1

Is this a false positive?: both implementations return
dma_request_slave_channel(), which is an inline wrapper converting the
ERR_PTR from dma_request_chan() to NULL before returning:

static inline struct dma_chan * __deprecated
dma_request_slave_channel(struct device *dev, const char *name)
{
struct dma_chan *ch = dma_request_chan(dev, name);

return IS_ERR(ch) ? NULL : ch;
}

So ->get_dma_channel() return NULL or a valid pointer.

The same function backs this up: the persistent Front-End channel a
few lines above comes from the same function pointer and is checked
with !pair->dma_chan[!dir], while the Back-End channel is requested
with dma_request_chan() directly and uses IS_ERR() -- the two check
styles in one function match the two APIs.

Best regards,
Slavin Liu