Merge tag 'uml-for-linus-6.4-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-block.git] / drivers / clk / clk-conf.c
index 2ef819606c4170caed8fd8d059ad97e3719599bd..1a4e6340f95ce4c276bc7df61c7c2590e0ad1d99 100644 (file)
@@ -33,9 +33,12 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
                        else
                                return rc;
                }
-               if (clkspec.np == node && !clk_supplier)
+               if (clkspec.np == node && !clk_supplier) {
+                       of_node_put(clkspec.np);
                        return 0;
+               }
                pclk = of_clk_get_from_provider(&clkspec);
+               of_node_put(clkspec.np);
                if (IS_ERR(pclk)) {
                        if (PTR_ERR(pclk) != -EPROBE_DEFER)
                                pr_warn("clk: couldn't get parent clock %d for %pOF\n",
@@ -48,10 +51,12 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
                if (rc < 0)
                        goto err;
                if (clkspec.np == node && !clk_supplier) {
+                       of_node_put(clkspec.np);
                        rc = 0;
                        goto err;
                }
                clk = of_clk_get_from_provider(&clkspec);
+               of_node_put(clkspec.np);
                if (IS_ERR(clk)) {
                        if (PTR_ERR(clk) != -EPROBE_DEFER)
                                pr_warn("clk: couldn't get assigned clock %d for %pOF\n",
@@ -93,10 +98,13 @@ static int __set_clk_rates(struct device_node *node, bool clk_supplier)
                                else
                                        return rc;
                        }
-                       if (clkspec.np == node && !clk_supplier)
+                       if (clkspec.np == node && !clk_supplier) {
+                               of_node_put(clkspec.np);
                                return 0;
+                       }
 
                        clk = of_clk_get_from_provider(&clkspec);
+                       of_node_put(clkspec.np);
                        if (IS_ERR(clk)) {
                                if (PTR_ERR(clk) != -EPROBE_DEFER)
                                        pr_warn("clk: couldn't get clock %d for %pOF\n",