diff options
author | Julia Lawall <julia@diku.dk> | 2010-09-04 00:12:43 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-06 18:29:17 -0700 |
commit | e8f7f43a4ad451ecfb2689985f99a9e276a08bba (patch) | |
tree | 013683284acf99afd3530a7751680fa0dab53bfc /fs/cachefiles/proc.c | |
parent | 1fd63041c49c5c6ed1fe58b7bccc2de462d51e2b (diff) |
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>
Diffstat (limited to 'fs/cachefiles/proc.c')
0 files changed, 0 insertions, 0 deletions