soc: rockchip: power-domain: fix err handle while probing
authorShawn Lin <shawn.lin@rock-chips.com>
Mon, 1 Feb 2016 08:18:40 +0000 (16:18 +0800)
committerHeiko Stuebner <heiko@sntech.de>
Tue, 2 Feb 2016 21:18:31 +0000 (22:18 +0100)
If we fail to probe the driver, we should not directly break
from the for_each_available_child_of_node since it calls of_node_get
while iterating. This patch add of_node_put to fix the unbalanced
call pair.

Fixes: 7c696693a4f5 ("soc: rockchip: power-domain: Add power domain driver")
Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
drivers/soc/rockchip/pm_domains.c

index 6cdffb13c862ec01ea03be8bca08df92f6b9d2ca..43155e1f97b92ca7ee8f05b901ad681501041d80 100644 (file)
@@ -423,6 +423,7 @@ static int rockchip_pm_domain_probe(struct platform_device *pdev)
                if (error) {
                        dev_err(dev, "failed to handle node %s: %d\n",
                                node->name, error);
+                       of_node_put(node);
                        goto err_out;
                }
        }