Patch "dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dmaengine-fsldma-fix-a-resource-leak-in-an-error-han.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 61d37ae5d5ebc03fc8a00823a5d9d2d8ef218a6f
Author: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
Date:   Sat Dec 12 17:06:14 2020 +0100

    dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function
    
    [ Upstream commit b202d4e82531a62a33a6b14d321dd2aad491578e ]
    
    In case of error, the previous 'fsl_dma_chan_probe()' calls must be undone
    by some 'fsl_dma_chan_remove()', as already done in the remove function.
    
    It was added in the remove function in commit 77cd62e8082b ("fsldma: allow
    Freescale Elo DMA driver to be compiled as a module")
    
    Fixes: d3f620b2c4fe ("fsldma: simplify IRQ probing and handling")
    Signed-off-by: Christophe JAILLET <christophe.jaillet@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20201212160614.92576-1-christophe.jaillet@xxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c
index 996f1d7623d69..eae385a312b88 100644
--- a/drivers/dma/fsldma.c
+++ b/drivers/dma/fsldma.c
@@ -1214,6 +1214,7 @@ static int fsldma_of_probe(struct platform_device *op)
 {
 	struct fsldma_device *fdev;
 	struct device_node *child;
+	unsigned int i;
 	int err;
 
 	fdev = kzalloc(sizeof(*fdev), GFP_KERNEL);
@@ -1292,6 +1293,10 @@ static int fsldma_of_probe(struct platform_device *op)
 	return 0;
 
 out_free_fdev:
+	for (i = 0; i < FSL_DMA_MAX_CHANS_PER_DEVICE; i++) {
+		if (fdev->chan[i])
+			fsl_dma_chan_remove(fdev->chan[i]);
+	}
 	irq_dispose_mapping(fdev->irq);
 	iounmap(fdev->regs);
 out_free:



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux