Files
android_kernel_xiaomi_sm8450/arch/powerpc/platforms/pseries
Julia Lawall 7a19081fc2 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>
2011-09-20 09:19:49 +10:00
..
2011-07-26 16:49:47 -07:00
2011-01-10 08:51:44 -08:00
2011-07-26 16:49:47 -07:00
2010-11-29 15:48:22 +11:00
2010-11-03 10:23:26 -04:00
2011-09-20 09:19:49 +10:00
2010-07-14 17:14:00 +10:00
2011-07-26 16:49:47 -07:00