]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ata: pata_pxa: Fix DMA channel leak on probe error
authorWentao Liang <vulab@iscas.ac.cn>
Thu, 25 Jun 2026 14:18:37 +0000 (22:18 +0800)
committerDamien Le Moal <dlemoal@kernel.org>
Fri, 3 Jul 2026 04:44:18 +0000 (13:44 +0900)
When dmaengine_slave_config() fails, the DMA channel acquired by
dma_request_chan() is not released before returning the error,
leaking the channel reference.

Fix by adding dma_release_channel() in the error path.

The ata_host_activate() error path already correctly releases the
DMA channel.

Cc: stable@vger.kernel.org
Fixes: 88622d80af82 ("ata: pata_pxa: dmaengine conversion")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
drivers/ata/pata_pxa.c

index 03dbaf4a13a75c441456484095ee05794aecea73..9f63bdfb8576e302e1e79519e9db544c3e6e2425 100644 (file)
@@ -286,6 +286,7 @@ static int pxa_ata_probe(struct platform_device *pdev)
        ret = dmaengine_slave_config(data->dma_chan, &config);
        if (ret < 0) {
                dev_err(&pdev->dev, "dma configuration failed: %d\n", ret);
+               dma_release_channel(data->dma_chan);
                return ret;
        }