diff options
author | Julia Lawall <julia@diku.dk> | 2011-08-07 21:18:00 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2011-09-19 19:19:49 -0400 |
commit | 7a19081fc2658157a1b84e6f3288450c33d98569 (patch) | |
tree | d76a01044ddba8ce3136729b217706663055db75 /usr | |
parent | 6dece0eb69b2a28e18d104bc5d707f1cb673f5e0 (diff) |
pseries/iommu: Add missing kfree
At this point, window has not been stored anywhere, so it has to be freed
before leaving the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@exists@
local idexpression x;
statement S,S1;
expression E;
identifier fl;
expression *ptr != NULL;
@@
x = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...kfree(x)...+> }
when any
when != true x == NULL
x->fl
...>
(
if (x == NULL) S1
|
if (...) { ... when != x
when forall
(
return \(0\|<+...x...+>\|ptr\);
|
* return ...;
)
}
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'usr')
0 files changed, 0 insertions, 0 deletions