1
0
Fork 0

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>
hifive-unleashed-5.1
Wei Yongjun 2016-07-10 02:17:36 +00:00 committed by Linus Walleij
parent fcce9f14f0
commit bfab7c8ff8
1 changed files with 1 additions and 0 deletions

View File

@ -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);
}