Commit af449c33 authored by Julia Lawall's avatar Julia Lawall Committed by Paul Mackerras

[POWERPC] arch/powerpc: Add missing of_node_put

There should be an of_node_put when breaking out of a loop that iterates
over calls to of_find_all_nodes, as this function does an of_node_get on
the value it returns.

This was fixed using the following semantic patch.
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
type T;
identifier d;
expression e;
@@

T *d;
...
for (d = NULL; (d = of_find_all_nodes(d)) != NULL; )
 {... when != of_node_put(d)
      when != e = d
(
   return d;
|
+  of_node_put(d);
?  return ...;
)
...}
// </smpl>
Signed-off-by: default avatarJulia Lawall <julia@diku.dk>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent bd4c2edc
...@@ -163,8 +163,10 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl) ...@@ -163,8 +163,10 @@ static struct iommu_table *iommu_table_find(struct iommu_table * tbl)
(it->it_type == TCE_PCI) && (it->it_type == TCE_PCI) &&
(it->it_offset == tbl->it_offset) && (it->it_offset == tbl->it_offset) &&
(it->it_index == tbl->it_index) && (it->it_index == tbl->it_index) &&
(it->it_size == tbl->it_size)) (it->it_size == tbl->it_size)) {
of_node_put(node);
return it; return it;
}
} }
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment