These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / of / overlay.c
index dee9270..54e5af9 100644 (file)
@@ -149,6 +149,7 @@ static int of_overlay_apply_one(struct of_overlay *ov,
                        pr_err("%s: Failed to apply single node @%s/%s\n",
                                        __func__, target->full_name,
                                        child->name);
+                       of_node_put(child);
                        return ret;
                }
        }
@@ -333,7 +334,7 @@ static DEFINE_IDR(ov_idr);
  * of the overlay in a list. This list can be used to prevent
  * illegal overlay removals.
  *
- * Returns the id of the created overlay, or an negative error number
+ * Returns the id of the created overlay, or a negative error number
  */
 int of_overlay_create(struct device_node *tree)
 {
@@ -417,8 +418,10 @@ static int overlay_subtree_check(struct device_node *tree,
                return 1;
 
        for_each_child_of_node(tree, child) {
-               if (overlay_subtree_check(child, dn))
+               if (overlay_subtree_check(child, dn)) {
+                       of_node_put(child);
                        return 1;
+               }
        }
 
        return 0;
@@ -481,7 +484,7 @@ static int overlay_removal_is_ok(struct of_overlay *ov)
  *
  * Removes an overlay if it is permissible.
  *
- * Returns 0 on success, or an negative error number
+ * Returns 0 on success, or a negative error number
  */
 int of_overlay_destroy(int id)
 {
@@ -528,7 +531,7 @@ EXPORT_SYMBOL_GPL(of_overlay_destroy);
  *
  * Removes all overlays from the system in the correct order.
  *
- * Returns 0 on success, or an negative error number
+ * Returns 0 on success, or a negative error number
  */
 int of_overlay_destroy_all(void)
 {