Patch "mmc: cavium-thunderx: Add of_node_put() when breaking out of loop" 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

    mmc: cavium-thunderx: Add of_node_put() when breaking out of loop

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:
     mmc-cavium-thunderx-add-of_node_put-when-breaking-ou.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 7267aefaa328a9292521cd3eef30dce7c90b23cb
Author: Liang He <windhl@xxxxxxx>
Date:   Tue Jul 19 17:52:16 2022 +0800

    mmc: cavium-thunderx: Add of_node_put() when breaking out of loop
    
    [ Upstream commit 7ee480795e41db314f2c445c65ed854a5d6e8e32 ]
    
    In thunder_mmc_probe(), we should call of_node_put() when breaking
    out of for_each_child_of_node() which has increased and decreased
    the refcount during each iteration.
    
    Fixes: 166bac38c3c5 ("mmc: cavium: Add MMC PCI driver for ThunderX SOCs")
    Signed-off-by: Liang He <windhl@xxxxxxx>
    Acked-by: Robert Richter <rric@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220719095216.1241601-2-windhl@xxxxxxx
    Signed-off-by: Ulf Hansson <ulf.hansson@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mmc/host/cavium-thunderx.c b/drivers/mmc/host/cavium-thunderx.c
index eee08d81b242..f79806e31e7e 100644
--- a/drivers/mmc/host/cavium-thunderx.c
+++ b/drivers/mmc/host/cavium-thunderx.c
@@ -138,8 +138,10 @@ static int thunder_mmc_probe(struct pci_dev *pdev,
 				continue;
 
 			ret = cvm_mmc_of_slot_probe(&host->slot_pdev[i]->dev, host);
-			if (ret)
+			if (ret) {
+				of_node_put(child_node);
 				goto error;
+			}
 		}
 		i++;
 	}



[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