diff options
author | Yang Li <yang.lee@linux.alibaba.com> | 2021-02-26 09:34:57 +0800 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-03-10 14:41:13 +0100 |
commit | d2cd54c24e80b3da2d3071311a280aa19b782438 (patch) | |
tree | fecd64d4d2a8c9a96e3edf368342348607297b01 /drivers/pinctrl | |
parent | b37c35781d9ad929c150b2b0b1eb0070a312585b (diff) |
pinctrl: ingenic: add missing call to of_node_put()
In one of the error paths of the for_each_child_of_node() loop in
ingenic_gpio_probe, add missing call to of_node_put().
Fix the following coccicheck warning:
./drivers/pinctrl/pinctrl-ingenic.c:2485:1-23: WARNING: Function
"for_each_child_of_node" should have of_node_put() before return around
line 2489.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Acked-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/1614303297-24178-1-git-send-email-yang.lee@linux.alibaba.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl')
-rw-r--r-- | drivers/pinctrl/pinctrl-ingenic.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index f2746125b077..c8ecd014cf19 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -2485,8 +2485,10 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev) for_each_child_of_node(dev->of_node, node) { if (of_match_node(ingenic_gpio_of_match, node)) { err = ingenic_gpio_probe(jzpc, node); - if (err) + if (err) { + of_node_put(node); return err; + } } } |