Commit 76832d84 authored by Julia Lawall's avatar Julia Lawall Committed by Linus Torvalds

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: default avatarJulia Lawall <julia@diku.dk>
Acked-by: default avatarGrant Likely <grant.likely@secretlab.ca>
Acked-by: default avatarPeter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 72fad713
...@@ -393,6 +393,7 @@ static inline void __init ulite_console_of_find_device(int id) ...@@ -393,6 +393,7 @@ static inline void __init ulite_console_of_find_device(int id)
continue; continue;
ulite_ports[id].mapbase = res.start; ulite_ports[id].mapbase = res.start;
of_node_put(np);
return; return;
} }
} }
......
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