Commit a2d05fb7 authored by Yang Yingliang's avatar Yang Yingliang Committed by Bartosz Golaszewski

gpio: sim: add missing fwnode_handle_put() in gpio_sim_probe()

Calling fwnode_handle_put() when break out of device_for_each_child_node(),
or the device node reference will be leakd.

Fixes: 83960fcf4818 ("gpio: sim: new testing module")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Signed-off-by: default avatarBartosz Golaszewski <brgl@bgdev.pl>
parent 572006bc
......@@ -444,8 +444,10 @@ static int gpio_sim_probe(struct platform_device *pdev)
device_for_each_child_node(dev, swnode) {
ret = gpio_sim_add_bank(swnode, dev);
if (ret)
if (ret) {
fwnode_handle_put(swnode);
return ret;
}
}
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment