Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bfab7c8f authored by Wei Yongjun's avatar Wei Yongjun Committed by Linus Walleij
Browse files

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: 4ba8cfa7 ("gpio: dwapb: convert device node to fwnode")
Signed-off-by: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent fcce9f14
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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);
		}