Julia Lawall
cd0e280f1b
V4L/DVB (13413): introduce missing kfree
Error handling code following a kzalloc should free the allocated data.
Similarly for usb-alloc urb.
The semantic match that finds the first 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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2009-12-05 18:41:45 -02:00
..
2009-11-25 00:43:08 -05:00
2009-09-12 12:01:34 +01:00
2009-12-05 09:42:59 -08:00
2009-09-30 16:12:20 -07:00
2009-11-29 16:51:27 +01:00
2009-12-01 16:32:20 -08:00
2009-12-05 09:42:59 -08:00
2009-09-24 07:21:04 -07:00
2009-12-05 09:49:07 -08:00
2009-10-06 01:39:51 -07:00
2009-11-17 23:15:04 -05:00
2009-10-29 07:39:31 -07:00
2009-11-03 10:32:03 -05:00
2009-09-13 10:27:04 -07:00
2009-11-22 12:10:10 -07:00
2009-11-04 14:04:06 +01:00
2009-11-30 13:58:23 -08:00
2009-10-05 12:05:40 -07:00
2009-12-01 16:32:19 -08:00
2009-11-30 13:57:19 -08:00
2009-10-13 10:10:33 -07:00
2009-11-16 12:45:40 +01:00
2009-11-30 14:50:44 -08:00
2009-12-05 09:42:59 -08:00
2009-10-11 11:20:58 -07:00
2009-11-19 13:16:21 -08:00
2009-10-11 11:20:58 -07:00
2009-12-02 15:41:33 -08:00
2009-12-05 09:42:59 -08:00
2009-11-16 11:50:42 +00:00
2009-10-11 11:20:58 -07:00
2009-10-14 16:58:35 +11:00
2009-12-01 17:30:59 +11:00
2009-12-05 18:41:45 -02:00
2009-09-24 07:21:05 -07:00
2009-10-11 11:20:58 -07:00
2009-12-01 11:24:19 +01:00
2009-11-26 09:22:33 +01:00
2009-12-02 22:58:19 +08:00
2009-12-05 09:42:59 -08:00
2009-12-05 09:42:59 -08:00
2009-10-15 09:58:27 -06:00
2009-10-09 21:32:05 +02:00
2009-09-22 07:17:38 -07:00
2009-11-28 18:03:14 +01:00
2009-12-05 09:49:07 -08:00
2009-12-05 09:42:59 -08:00
2009-11-25 01:01:29 -05:00
2009-09-25 15:09:48 -04:00
2009-09-23 03:49:27 +04:00
2009-11-12 07:26:01 -08:00
2009-09-11 11:28:00 +10:00
2009-12-02 19:37:16 +00:00
2009-12-01 16:32:20 -08:00
2009-11-13 15:45:03 +01:00
2009-09-22 07:17:25 -07:00
2009-12-05 09:42:59 -08:00
2009-12-05 09:42:59 -08:00
2009-10-03 01:16:12 -04:00
2009-12-02 23:58:32 +00:00
2009-12-05 09:42:59 -08:00
2009-12-05 09:42:59 -08:00
2009-11-09 08:30:05 +01:00
2009-11-05 17:33:24 -05:00
2009-11-13 11:36:00 +09:00
2009-12-05 09:42:59 -08:00
2009-10-11 11:20:58 -07:00
2009-12-02 23:58:32 +00:00
2009-10-29 08:50:37 +10:30
2009-09-24 07:21:05 -07:00
2009-10-04 22:53:41 +02:00
2009-12-02 12:47:24 +00:00
2009-10-04 15:05:10 -07:00
2009-09-23 10:07:49 -07:00