Patch "pinctrl: freescale: mxs: Fix refcount of child" 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

    pinctrl: freescale: mxs: Fix refcount of child

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:
     pinctrl-freescale-mxs-fix-refcount-of-child.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 5052ea4b00408c13fe129108ec66f69ebae5f83f
Author: Peng Fan <peng.fan@xxxxxxx>
Date:   Sat May 4 21:20:16 2024 +0800

    pinctrl: freescale: mxs: Fix refcount of child
    
    [ Upstream commit 7f500f2011c0bbb6e1cacab74b4c99222e60248e ]
    
    of_get_next_child() will increase refcount of the returned node, need
    use of_node_put() on it when done.
    
    Per current implementation, 'child' will be override by
    for_each_child_of_node(np, child), so use of_get_child_count to avoid
    refcount leakage.
    
    Fixes: 17723111e64f ("pinctrl: add pinctrl-mxs support")
    Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
    Link: https://lore.kernel.org/20240504-pinctrl-cleanup-v2-18-26c5f2dc1181@xxxxxxx
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pinctrl/freescale/pinctrl-mxs.c b/drivers/pinctrl/freescale/pinctrl-mxs.c
index a612e46ca51c0..c48b6fb5e8fe7 100644
--- a/drivers/pinctrl/freescale/pinctrl-mxs.c
+++ b/drivers/pinctrl/freescale/pinctrl-mxs.c
@@ -405,8 +405,8 @@ static int mxs_pinctrl_probe_dt(struct platform_device *pdev,
 	int ret;
 	u32 val;
 
-	child = of_get_next_child(np, NULL);
-	if (!child) {
+	val = of_get_child_count(np);
+	if (val == 0) {
 		dev_err(&pdev->dev, "no group is defined\n");
 		return -ENOENT;
 	}




[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