diff options
author | ZhangPeng <zhangpeng362@huawei.com> | 2022-11-22 07:58:53 +0000 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2022-11-22 09:35:27 +0100 |
commit | a8acc11643082a706de86a19f1f824712d971984 (patch) | |
tree | 4d7caac661d239d4ef5423b284e8c105e7f4fc8d /drivers/pinctrl/pinctrl-k210.c | |
parent | ac8a616c32e12f01878d54f2e7077720dc3dc305 (diff) | |
download | lwn-a8acc11643082a706de86a19f1f824712d971984.tar.gz lwn-a8acc11643082a706de86a19f1f824712d971984.zip |
pinctrl: k210: call of_node_put()
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.
Fixes: d4c34d09ab03 ("pinctrl: Add RISC-V Canaan Kendryte K210 FPIOA driver")
Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20221122075853.2496680-1-zhangpeng362@huawei.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-k210.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-k210.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-k210.c b/drivers/pinctrl/pinctrl-k210.c index 288e44457fec..97920fb517bc 100644 --- a/drivers/pinctrl/pinctrl-k210.c +++ b/drivers/pinctrl/pinctrl-k210.c @@ -864,8 +864,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; |