mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-09 06:33:34 +00:00
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: Hulk Robot <hulkci@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
This commit is contained in:
parent
572006bce3
commit
a2d05fb734
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user