drivers/net/wireless/wl12xx: add missing kfree
authorJulia Lawall <julia@diku.dk>
Fri, 12 Aug 2011 17:31:30 +0000 (13:31 -0400)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 12 Aug 2011 17:33:31 +0000 (13:33 -0400)
commitf8afdf481f0fef5e170c6c928cec42879d505654
treed5731d783f50c21f5fd0bbff19dc80995589b698
parent674db1344443204b6ce3293f2df8fd1b7665deea
drivers/net/wireless/wl12xx: add missing kfree

In each case, the freed data should be freed in the error handling code
as
well.

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: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/wl12xx/acx.c
drivers/net/wireless/wl12xx/testmode.c