[PATCH] dmaengine: fsl-edma: Fix channel leak in fsl_edma_xlate()

From: Wentao Liang

Date: Wed Sep 16 2026 - 05:32:29 EST


fsl_edma_xlate() grabs a channel with dma_get_slave_channel() before
validating the requested srcid. If the srcid turns out to be invalid,
the function just returns NULL, leaving the channel with its client
count elevated and marked private, so it can never be requested again.

Release the channel with dma_release_channel() before returning NULL.

Fixes: 6aa60f79e679 ("dmaengine: fsl-edma: add safety check for 'srcid'")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
---
drivers/dma/fsl-edma-main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/dma/fsl-edma-main.c b/drivers/dma/fsl-edma-main.c
index 36155ab1602a..11fbf6b1609b 100644
--- a/drivers/dma/fsl-edma-main.c
+++ b/drivers/dma/fsl-edma-main.c
@@ -279,6 +279,7 @@ static struct dma_chan *fsl_edma_xlate(struct of_phandle_args *dma_spec,
if (!fsl_chan->srcid) {
dev_err(&fsl_chan->pdev->dev, "Invalidate srcid %d\n",
fsl_chan->srcid);
+ dma_release_channel(chan);
return NULL;
}

--
2.34.1