Skip to content

Commit fcaf242

Browse files
ISCAS-Vulabdamien-lemoal
authored andcommitted
ata: pata_pxa: Fix DMA channel leak on probe error
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: 88622d8 ("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>
1 parent c0ace41 commit fcaf242

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/ata/pata_pxa.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ static int pxa_ata_probe(struct platform_device *pdev)
286286
ret = dmaengine_slave_config(data->dma_chan, &config);
287287
if (ret < 0) {
288288
dev_err(&pdev->dev, "dma configuration failed: %d\n", ret);
289+
dma_release_channel(data->dma_chan);
289290
return ret;
290291
}
291292

0 commit comments

Comments
 (0)