2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-14 14:06:50 -07:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
2007-09-14 14:22:36 -05:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-01-31 20:33:41 +00:00
|
|
|
|
2011-03-07 14:00:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-14 14:06:50 -07:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-03-25 16:45:20 +01:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-14 14:06:50 -07:00
|
|
|
|
2009-12-08 02:39:50 +00:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-04-23 12:30:01 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-02-14 14:06:50 -07:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-09-14 14:22:36 -05:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
2007-09-14 14:22:36 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2007-09-14 14:22:36 -05:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-08-28 18:47:54 +10:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2011-06-09 09:13:32 -07:00
|
|
|
|
[POWERPC] arch/powerpc/sysdev: Add missing of_node_put
The functions of_find_compatible_node and of_find_node_by_type both
call of_node_get on their result. So any error handling code
thereafter should call of_node_put(np). This is taken care of in the
case where there is a goto out, but not when there is a direct return.
The function irq_alloc_host puts np into the returned structure, which is
stored in the global variable mpc8xx_pic_host, so the reference count
should be set for the lifetime of that variable. The current solution ups
the reference count again in the argument to irq_alloc_host so that it can
be decremented on the way out. This seems a bit unnecessary, and also
doesn't work in the case where irq_alloc_host fails, because then the
reference count only goes does by one, whereas it should go down by two. A
better solution is to not increment the reference count in the argument to
irq_alloc_host and only decrement it on the way out in an 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>
2008-02-04 23:34:59 -08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2012-02-14 14:06:54 -07:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[POWERPC] arch/powerpc/sysdev: Add missing of_node_put
The functions of_find_compatible_node and of_find_node_by_type both
call of_node_get on their result. So any error handling code
thereafter should call of_node_put(np). This is taken care of in the
case where there is a goto out, but not when there is a direct return.
The function irq_alloc_host puts np into the returned structure, which is
stored in the global variable mpc8xx_pic_host, so the reference count
should be set for the lifetime of that variable. The current solution ups
the reference count again in the argument to irq_alloc_host so that it can
be decremented on the way out. This seems a bit unnecessary, and also
doesn't work in the case where irq_alloc_host fails, because then the
reference count only goes does by one, whereas it should go down by two. A
better solution is to not increment the reference count in the argument to
irq_alloc_host and only decrement it on the way out in an 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>
2008-02-04 23:34:59 -08:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
[POWERPC] arch/powerpc/sysdev: Add missing of_node_put
The functions of_find_compatible_node and of_find_node_by_type both
call of_node_get on their result. So any error handling code
thereafter should call of_node_put(np). This is taken care of in the
case where there is a goto out, but not when there is a direct return.
The function irq_alloc_host puts np into the returned structure, which is
stored in the global variable mpc8xx_pic_host, so the reference count
should be set for the lifetime of that variable. The current solution ups
the reference count again in the argument to irq_alloc_host so that it can
be decremented on the way out. This seems a bit unnecessary, and also
doesn't work in the case where irq_alloc_host fails, because then the
reference count only goes does by one, whereas it should go down by two. A
better solution is to not increment the reference count in the argument to
irq_alloc_host and only decrement it on the way out in an 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>
2008-02-04 23:34:59 -08:00
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
2007-08-28 18:47:54 +10:00
|
|
|
|
|
|
|
|
|
2007-01-24 22:41:24 +03:00
|
|
|
|
|
|
|
|
|