pinctrl: call of_node_put() when breaking out of for_each_available_child_of_node()
Subsystems (4)
PATCH 1/1 pinctrl: call of_node_put() when breaking out of for_each_available_child_of_node()
From: ZhangPeng <[email protected]>
Since for_each_available_child_of_node() will increase the refcount of node, we need to call of_node_put() manually when breaking out of the iteration.
--- drivers/pinctrl/pinctrl-k210.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pinctrl/pinctrl-k210.c +3 -1
@@ -862,8 +862,10 @@ static int k210_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,for_each_available_child_of_node (np_config, np) { ret =k210_pinctrl_dt_subnode_to_map (pctldev, np, map, &reserved_maps, num_maps); -if (ret <0 ) +if (ret <0 ) { +of_node_put (np); goto err; + } }return 0 ;
Signature · 1 line
2.25.1
Quoted 18 lines · Peng Zhang
From: ZhangPeng <[email protected]>
Since
for_each_available_child_of_node()will increase the refcount of node, we need to callof_node_put()manually when breaking out of the iteration.Fixes d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")Signed-off-by ZhangPeng <[email protected]>--- drivers/pinctrl/pinctrl-k210.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/pinctrl/pinctrl-k210.c +0
-0@@ -862,8 +862,10 @@ static int k210_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,for_each_available_child_of_node (np_config, np) {
drivers/pinctrl/pinctrl-k210.c static int k210_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev, · line 871
Quoted 10 lines
drivers/pinctrl/pinctrl-k210.c +3
-1ret =k210_pinctrl_dt_subnode_to_map (pctldev, np, map, &reserved_maps, num_maps); -if (ret <0 ) +if (ret <0 ) { +of_node_put (np); goto err; + } }return 0 ;
Signature · 7 lines
Damien Le Moal Western Digital Research _______________________________________________ linux-riscv mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-riscv
Quoted 8 lines · Peng Zhang
From: ZhangPeng <[email protected]>
Since
for_each_available_child_of_node()will increase the refcount of node, we need to callof_node_put()manually when breaking out of the iteration.Fixes d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")Signed-off-by ZhangPeng <[email protected]>
Patch applied.
Yours,
Linus Walleij