]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
drivers/serial/uartlite.c: Add missing of_node_put
authorJulia Lawall <julia@diku.dk>
Mon, 10 Dec 2007 23:49:28 +0000 (15:49 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 11 Dec 2007 03:43:55 +0000 (19:43 -0800)
commit76832d8416430d6dd0575579ca1e00d1a790f4cb
treeea023cf43ba81487b8361c7ccf5cd9a9cdf9aabd
parent72fad7139b6829f71d7f41f39eb30da5760d90a8
drivers/serial/uartlite.c: Add missing of_node_put

There should be an of_node_put when breaking out of a loop that iterates
using for_each_compatible_node.

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_compatible_node;
@@

T *d;
...
for_each_compatible_node(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>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/serial/uartlite.c