* [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put
@ 2007-12-02 20:06 Julia Lawall
2007-12-03 15:18 ` Grant Likely
2007-12-04 15:53 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2007-12-02 20:06 UTC (permalink / raw)
To: jacmet, linux-kernel, kernel-janitors
From: Julia Lawall <julia@diku.dk>
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>
---
diff -u -p a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
--- a/drivers/serial/uartlite.c 2007-11-12 10:35:57.000000000 +0100
+++ b/drivers/serial/uartlite.c 2007-12-02 17:43:57.000000000 +0100
@@ -393,6 +393,7 @@ static inline void __init ulite_console_
continue;
ulite_ports[id].mapbase = res.start;
+ of_node_put(np);
return;
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put
2007-12-02 20:06 [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put Julia Lawall
@ 2007-12-03 15:18 ` Grant Likely
2007-12-04 15:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Grant Likely @ 2007-12-03 15:18 UTC (permalink / raw)
To: linux-kernel
Julia Lawall <julia <at> diku.dk> writes:
> There should be an of_node_put when breaking out of a loop that iterates
> using for_each_compatible_node.
>
<snip>
>
> Signed-off-by: Julia Lawall <julia <at> diku.dk>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
And this should go in for .24
g.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put
2007-12-02 20:06 [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put Julia Lawall
2007-12-03 15:18 ` Grant Likely
@ 2007-12-04 15:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2007-12-04 15:53 UTC (permalink / raw)
To: Julia Lawall; +Cc: linux-kernel, kernel-janitors
>>>>> "Julia" == Julia Lawall <julia@diku.dk> writes:
Julia> From: Julia Lawall <julia@diku.dk>
Julia> There should be an of_node_put when breaking out of a loop
Julia> that iterates using for_each_compatible_node.
..
Julia> Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-04 15:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-02 20:06 [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put Julia Lawall
2007-12-03 15:18 ` Grant Likely
2007-12-04 15:53 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).