Julia Lawall
06e182911d
USB: xhci-mem.c: introduce missing kfree
Error handling code following a kzalloc should free the allocated data.
The semantic match that finds this problem is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@r exists@
local idexpression x;
statement S;
expression E;
identifier f,f1,l;
position p1,p2;
expression *ptr != NULL;
@@
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
<... when != x
when != if (...) { <+...x...+> }
(
x->f1 = E
|
(x->f1 == NULL || ...)
|
f(...,x->f1,...)
)
...>
(
return \(0\|<+...x...+>\|ptr\);
|
return@p2 ...;
)
@script:python@
p1 << r.p1;
p2 << r.p2;
@@
print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 11:55:26 -08:00
..
2009-12-09 19:57:06 -08:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-11 11:55:21 -08:00
2009-12-09 19:03:16 -08:00
2009-12-09 19:52:01 -08:00
2009-11-17 23:15:04 -05:00
2009-12-07 18:36:35 +01:00
2009-12-06 11:18:28 +01:00
2009-12-09 19:43:33 -08:00
2009-12-03 20:11:06 +01:00
2009-12-09 19:43:33 -08:00
2009-12-04 22:10:59 -08:00
2009-12-01 16:32:19 -08:00
2009-12-09 19:57:06 -08:00
2009-12-11 11:55:21 -08:00
2009-12-09 19:53:11 -08:00
2009-12-09 19:57:06 -08:00
2009-12-09 19:45:38 -08:00
2009-12-09 19:43:33 -08:00
2009-12-02 01:13:11 -08:00
2009-12-09 19:43:33 -08:00
2009-12-10 09:34:40 -08:00
2009-12-09 19:43:33 -08:00
2009-12-08 08:15:29 -08:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-10 12:45:18 -02:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:52:01 -08:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-10 09:31:45 -08:00
2009-12-11 11:55:21 -08:00
2009-12-09 19:43:33 -08:00
2009-12-08 08:13:35 -08:00
2009-12-09 19:57:06 -08:00
2009-12-08 08:15:29 -08:00
2009-12-09 19:57:06 -08:00
2009-12-04 15:39:55 +01:00
2009-11-27 21:07:23 +01:00
2009-12-04 15:39:55 +01:00
2009-12-02 19:37:16 +00:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-12-04 15:39:55 +01:00
2009-12-09 19:43:33 -08:00
2009-12-09 19:43:33 -08:00
2009-11-30 12:15:04 +09:00
2009-12-09 19:43:33 -08:00
2009-12-05 15:22:26 -08:00
2009-12-09 19:50:49 -08:00
2009-12-07 18:36:35 +01:00
2009-12-11 11:55:26 -08:00
2009-12-04 15:39:55 +01:00
2009-12-10 09:34:40 -08:00
2009-12-09 19:43:33 -08:00
2009-12-10 09:35:02 -08:00
2009-12-06 11:18:28 +01:00