Patch "cxl: Fix refcount leak in cxl_calc_capp_routing" has been added to the 4.19-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

    cxl: Fix refcount leak in cxl_calc_capp_routing

to the 4.19-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:
     cxl-fix-refcount-leak-in-cxl_calc_capp_routing.patch
and it can be found in the queue-4.19 subdirectory.

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



commit 8d6eb9531b4a2cfafaa15d988500db808e208818
Author: Miaoqian Lin <linmq006@xxxxxxxxx>
Date:   Sun Jun 5 10:00:38 2022 +0400

    cxl: Fix refcount leak in cxl_calc_capp_routing
    
    [ Upstream commit 1d09697ff22908ae487fc8c4fbde1811732be523 ]
    
    of_get_next_parent() returns a node pointer with refcount incremented,
    we should use of_node_put() on it when not need anymore.
    This function only calls of_node_put() in normal path,
    missing it in the error path.
    Add missing of_node_put() to avoid refcount leak.
    
    Fixes: f24be42aab37 ("cxl: Add psl9 specific code")
    Signed-off-by: Miaoqian Lin <linmq006@xxxxxxxxx>
    Acked-by: Andrew Donnellan <ajd@xxxxxxxxxxxxx>
    Acked-by: Frederic Barrat <fbarrat@xxxxxxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20220605060038.62217-1-linmq006@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index acb4a339f5fe..8dbb1998c312 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -391,6 +391,7 @@ int cxl_calc_capp_routing(struct pci_dev *dev, u64 *chipid,
 	rc = get_phb_index(np, phb_index);
 	if (rc) {
 		pr_err("cxl: invalid phb index\n");
+		of_node_put(np);
 		return rc;
 	}
 



[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