Patch "pinctrl: pinconf-generic: add missing of_node_put()" has been added to the 4.14-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: pinconf-generic: add missing of_node_put()

to the 4.14-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-pinconf-generic-add-missing-of_node_put.patch
and it can be found in the queue-4.14 subdirectory.

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



commit 512aebdaa4c13147a0b5a78160af8eb554dee15d
Author: ZhangPeng <zhangpeng362@xxxxxxxxxx>
Date:   Fri Nov 25 07:01:56 2022 +0000

    pinctrl: pinconf-generic: add missing of_node_put()
    
    [ Upstream commit 5ead93289815a075d43c415e35c8beafafb801c9 ]
    
    of_node_put() needs to be called when jumping out of the loop, since
    for_each_available_child_of_node() will increase the refcount of node.
    
    Fixes: c7289500e29d ("pinctrl: pinconf-generic: scan also referenced phandle node")
    Signed-off-by: ZhangPeng <zhangpeng362@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221125070156.3535855-1-zhangpeng362@xxxxxxxxxx
    Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/pinctrl/pinconf-generic.c b/drivers/pinctrl/pinconf-generic.c
index 6f6fd5e6b68c..07e29fc7443d 100644
--- a/drivers/pinctrl/pinconf-generic.c
+++ b/drivers/pinctrl/pinconf-generic.c
@@ -388,8 +388,10 @@ int pinconf_generic_dt_node_to_map(struct pinctrl_dev *pctldev,
 	for_each_available_child_of_node(np_config, np) {
 		ret = pinconf_generic_dt_subnode_to_map(pctldev, np, map,
 					&reserved_maps, num_maps, type);
-		if (ret < 0)
+		if (ret < 0) {
+			of_node_put(np);
 			goto exit;
+		}
 	}
 	return 0;
 



[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