Julia Lawall e8f7f43a4a drivers/net/fs_enet/fs_enet-main.c: Add of_node_put to avoid memory leak
In this case, a device_node structure is stored in another structure that
is then freed without first decrementing the reference count of the
device_node structure.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression x;
identifier f;
position p1,p2;
@@

x@p1->f = \(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\|of_find_node_by_type\|of_find_node_with_property\|of_find_matching_node\|of_parse_phandle\|of_node_get\)(...);
... when != of_node_put(x)
kfree@p2(x)

@script:python@
p1 << r.p1;
p2 << r.p2;
@@
cocci.print_main("call",p1)
cocci.print_secs("free",p2)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2010-09-06 18:29:17 -07:00
..
2010-05-10 05:01:31 -07:00
2010-08-28 15:37:04 -07:00
2010-09-03 09:44:51 -07:00
2010-09-06 13:32:20 -07:00
2009-09-01 01:13:50 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-06-16 18:05:05 +02:00
2010-06-03 03:18:23 -07:00
2010-07-19 15:27:13 -07:00
2010-07-11 18:15:08 -07:00
2010-07-11 18:15:08 -07:00
2010-05-10 05:01:31 -07:00
2010-07-08 23:42:40 -07:00
2010-08-24 12:24:07 -07:00
2010-02-26 02:10:14 -08:00
2010-06-25 20:37:21 -07:00
2010-07-19 13:32:57 -07:00
2010-07-14 13:40:36 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2009-11-11 19:22:21 -08:00
2010-05-10 05:01:31 -07:00
2010-05-17 22:47:34 -07:00
2010-07-14 17:57:19 -07:00
2010-08-24 12:23:01 -07:00
2010-05-10 05:01:31 -07:00
2010-03-18 21:14:00 -07:00
2010-07-27 22:24:37 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-06-21 13:40:25 -07:00
2010-07-05 20:08:05 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-06-28 12:41:33 -07:00
2010-08-25 16:36:48 -07:00
2010-08-04 21:53:17 -07:00
2010-08-04 21:53:17 -07:00
2010-08-04 21:53:17 -07:00
2010-09-02 09:19:32 -07:00
2010-08-25 16:41:27 -07:00
2010-09-05 20:04:05 -07:00
2010-07-15 20:46:22 -07:00
2010-08-25 16:41:26 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-09-01 10:57:55 -07:00
2010-07-30 23:59:04 -07:00
2010-06-03 03:18:23 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-05-10 05:01:31 -07:00
2010-07-14 12:17:35 -07:00
2010-05-10 05:01:31 -07:00
2010-08-02 15:46:33 -07:00
2010-04-14 16:11:33 -07:00
2010-06-03 03:18:23 -07:00
2010-05-10 05:01:31 -07:00