diff options
author | Julia Lawall <julia@diku.dk> | 2008-02-05 02:34:58 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-02-06 06:06:59 -0500 |
commit | 842decbd674106d63a67e07a2f8cec5af70fdb40 (patch) | |
tree | b7ea2ccc5259285295709e9c1ed8c58a738db9c9 | |
parent | 551ed332da2f52daf5d01fc76d2a894aba79d316 (diff) |
[POWERPC] arch/powerpc/platforms/pseries: Add missing of_node_put
Of_get_parent and of_find_compatible_node do an of_node_get, and thus a
corresponding of_code_put is needed in the error case.
The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
type T,T1,T2;
identifier E;
statement S;
expression x1,x2,x3;
int ret;
@@
T E;
...
* E = \(of_get_parent\|of_find_compatible_node\)(...);
if (E == NULL) S
... when != of_node_put(...,(T1)E,...)
when != if (E != NULL) { ... of_node_put(...,(T1)E,...); ...}
when != x1 = (T1)E
when != E = x3;
when any
if (...) {
... when != of_node_put(...,(T2)E,...)
when != if (E != NULL) { ... of_node_put(...,(T2)E,...); ...}
when != x2 = (T2)E
(
* return;
|
* return ret;
)
}
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index c02f8742c54d..2800fced8c7c 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -167,6 +167,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np) | |||
167 | 167 | ||
168 | if ((child = of_get_next_child(np, NULL))) { | 168 | if ((child = of_get_next_child(np, NULL))) { |
169 | of_node_put(child); | 169 | of_node_put(child); |
170 | of_node_put(parent); | ||
170 | return -EBUSY; | 171 | return -EBUSY; |
171 | } | 172 | } |
172 | 173 | ||