From: Julia Lawall <julia@diku.dk>
To: jacmet@sunsite.dk, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] drivers/serial/uartlite.c: Add missing of_node_put
Date: Sun, 2 Dec 2007 21:06:54 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.0712022105480.3361@ask.diku.dk> (raw)
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;
}
}
next reply other threads:[~2007-12-02 20:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-02 20:06 Julia Lawall [this message]
2007-12-03 15:18 ` Grant Likely
2007-12-04 15:53 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.64.0712022105480.3361@ask.diku.dk \
--to=julia@diku.dk \
--cc=jacmet@sunsite.dk \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®