Patch "spi: dln2: Fix reference leak to master" 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

    spi: dln2: Fix reference leak to master

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:
     spi-dln2-fix-reference-leak-to-master.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 d1ec6f1c99a7628d75a9ab1d8718889e40bf3ae1
Author: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
Date:   Fri Apr 9 08:29:55 2021 +0000

    spi: dln2: Fix reference leak to master
    
    [ Upstream commit 9b844b087124c1538d05f40fda8a4fec75af55be ]
    
    Call spi_master_get() holds the reference count to master device, thus
    we need an additional spi_master_put() call to reduce the reference
    count, otherwise we will leak a reference to master.
    
    This commit fix it by removing the unnecessary spi_master_get().
    
    Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
    Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20210409082955.2907950-1-weiyongjun1@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-dln2.c b/drivers/spi/spi-dln2.c
index 75b33d7d14b0..9a4d942fafcf 100644
--- a/drivers/spi/spi-dln2.c
+++ b/drivers/spi/spi-dln2.c
@@ -780,7 +780,7 @@ exit_free_master:
 
 static int dln2_spi_remove(struct platform_device *pdev)
 {
-	struct spi_master *master = spi_master_get(platform_get_drvdata(pdev));
+	struct spi_master *master = platform_get_drvdata(pdev);
 	struct dln2_spi *dln2 = spi_master_get_devdata(master);
 
 	pm_runtime_disable(&pdev->dev);



[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