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>
 
        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;