mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 13:51:44 +00:00
gpio: dwapb: add missing fwnode_handle_put() in dwapb_gpio_get_pdata()
fwnode_handle_put() should be used when terminating
device_for_each_child_node() iteration with break or
return to prevent stale device node references from
being left behind.
Generated by Coccinelle.
Fixes: 4ba8cfa79f
("gpio: dwapb: convert device node to fwnode")
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
parent
fcce9f14f0
commit
bfab7c8ff8
@ -486,6 +486,7 @@ dwapb_gpio_get_pdata(struct device *dev)
|
||||
pp->idx >= DWAPB_MAX_PORTS) {
|
||||
dev_err(dev,
|
||||
"missing/invalid port index for port%d\n", i);
|
||||
fwnode_handle_put(fwnode);
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user