Skip to content

Commit

Permalink
[POWERPC] cell/cbe_regs.c: Add missing of_node_put
Browse files Browse the repository at this point in the history
There should be an of_node_put when breaking out of a loop that iterates
using for_each_node_by_type.

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

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

T *d;
...
for_each_node_by_type(d,...)
  {... when != of_node_put(d)
       when != e = d
(
   return d;
|
+  of_node_put(d);
?  return ...;
)
...}
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Christian Krafft <krafft@de.ibm.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: David Erb <djerb@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
  • Loading branch information
Julia Lawall authored and Paul Mackerras committed Dec 20, 2007
1 parent af449c3 commit 1fe58a8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/powerpc/platforms/cell/cbe_regs.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ void __init cbe_regs_init(void)
printk(KERN_ERR "cbe_regs: More BE chips than supported"
"!\n");
cbe_regs_map_count--;
of_node_put(cpu);
return;
}
map->cpu_node = cpu;
Expand Down

0 comments on commit 1fe58a8

Please sign in to comment.