From: Julia Lawall Date: Mon, 10 Dec 2007 23:49:28 +0000 (-0800) Subject: drivers/serial/uartlite.c: Add missing of_node_put X-Git-Tag: v2.6.24-rc5~8 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76832d8416430d6dd0575579ca1e00d1a790f4cb;p=linux-2.6 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/) // @@ 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 ...; ) ...} // Signed-off-by: Julia Lawall Acked-by: Grant Likely Acked-by: Peter Korsgaard Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c index a85f2d31a6..3f593247c4 100644 --- a/drivers/serial/uartlite.c +++ b/drivers/serial/uartlite.c @@ -393,6 +393,7 @@ static inline void __init ulite_console_of_find_device(int id) continue; ulite_ports[id].mapbase = res.start; + of_node_put(np); return; } }