Julia Lawall
05f25abcf6
powerpc/5200: mpc52xx_uart.c: Add of_node_put to avoid memory leak
...
Add a call to of_node_put in the error handling code following a call to
of_find_compatible_node.
The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/ )
// <smpl>
@r exists@
local idexpression x;
expression E,E1;
statement S;
@@
*x =
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
... when != of_node_put(x)
when != if (...) { ... of_node_put(x); ... }
(
return <+...x...+>;
|
* return ...;
)
}
...>
of_node_put(x);
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk >
Acked-by: Wolfram Sang <w.sang@pengutronix.de >
Signed-off-by: Grant Likely <grant.likely@secretlab.ca >
2010-09-08 13:54:48 -06:00
..
2010-08-06 09:25:50 -06:00
2010-03-30 22:02:32 +09:00
2010-08-23 18:17:20 -07:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-08-10 13:47:45 -07:00
2010-04-30 09:20:34 -07:00
2010-08-10 13:47:46 -07:00
2009-09-19 13:13:19 -07:00
2010-08-10 13:47:41 -07:00
2010-08-23 18:17:22 -07:00
2010-08-10 13:47:44 -07:00
2010-05-21 09:34:30 -07:00
2010-08-10 13:47:45 -07:00
2010-07-27 10:48:43 +01:00
2010-07-27 10:48:43 +01:00
2010-08-06 09:25:50 -06:00
2009-11-04 08:44:54 -08:00
2010-08-10 13:47:45 -07:00
2010-03-02 14:43:19 -08:00
2010-08-10 13:47:41 -07:00
2010-05-21 09:34:30 -07:00
2010-05-21 09:34:27 -07:00
2009-09-19 13:13:28 -07:00
2010-08-10 13:47:44 -07:00
2009-04-07 08:44:05 -07:00
2009-09-19 13:13:28 -07:00
2010-03-02 14:43:22 -08:00
2010-08-10 13:47:41 -07:00
2010-08-10 13:47:41 -07:00
2010-08-10 13:47:41 -07:00
2009-09-19 13:13:31 -07:00
2010-08-11 09:13:19 -07:00
2010-08-05 09:22:30 -05:00
2009-09-19 13:13:28 -07:00
2010-08-10 13:47:46 -07:00
2010-08-10 13:47:41 -07:00
2010-08-10 13:47:44 -07:00
2010-08-10 13:47:44 -07:00
2010-08-10 13:47:46 -07:00
2010-08-10 13:47:45 -07:00
2010-08-10 13:47:46 -07:00
2010-09-08 13:54:48 -06:00
2010-04-07 14:12:36 +10:00
2010-08-10 13:47:39 -07:00
2010-08-10 13:47:39 -07:00
2010-06-04 13:37:16 -07:00
2010-06-04 13:37:16 -07:00
2010-03-30 22:02:32 +09:00
2009-09-19 13:13:28 -07:00
2010-08-06 09:25:50 -06:00
2010-08-16 23:44:49 -06:00
2010-06-02 17:50:38 +10:00
2010-02-27 18:31:02 +01:00
2009-09-19 13:13:31 -07:00
2010-03-30 22:02:32 +09:00
2009-12-01 01:33:51 +00:00
2009-07-30 23:56:41 +01:00
2009-12-01 01:33:51 +00:00
2010-02-03 01:55:01 +00:00
2009-12-01 01:33:51 +00:00
2009-07-30 23:56:41 +01:00
2010-08-05 18:32:42 +09:00
2009-09-28 18:06:16 +01:00
2010-08-05 18:32:41 +09:00
2010-01-19 17:50:47 +09:00
2009-09-19 13:13:31 -07:00
2009-09-19 13:13:28 -07:00
2010-08-10 13:47:43 -07:00
2010-08-03 09:04:11 +02:00
2010-04-23 10:01:56 +01:00
2009-09-19 13:13:31 -07:00
2009-10-01 16:11:15 -07:00
2010-05-31 13:14:26 +09:00
2010-05-24 08:53:37 +09:00
2010-08-21 00:34:45 -07:00
2010-08-16 12:26:09 -07:00
2009-11-24 14:09:56 -08:00
2010-08-06 09:25:50 -06:00
2010-08-06 09:25:50 -06:00
2010-08-06 09:25:50 -06:00
2010-08-06 09:25:50 -06:00
2010-08-10 13:47:45 -07:00
2009-06-11 08:51:06 -07:00
2010-08-06 09:25:50 -06:00
2010-08-06 09:25:50 -06:00
2009-09-19 13:13:31 -07:00
2009-09-19 13:13:31 -07:00