Julia Lawall
c37457e69f
drivers/net/wireless/iwlwifi: introduce missing kfree
...
Move orthogonal error handling code up before a kzalloc, so that it
doesn't have to free the allocated data.
The semantic match that finds the 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: Zhu Yi <yi.zhu@intel.com >
Signed-off-by: John W. Linville <linville@tuxdriver.com >
2009-08-03 16:31:22 -04:00
..
2009-06-24 01:22:20 -04:00
2009-06-23 01:54:30 -04:00
2009-06-16 19:50:13 -07:00
2009-06-18 09:56:20 +02:00
2009-06-15 03:02:23 -07:00
2009-06-24 09:55:50 -07:00
2009-06-17 16:37:26 +09:00
2009-07-21 12:43:51 -07:00
2009-06-15 11:49:41 -04:00
2009-06-18 19:31:09 +08:00
2009-06-24 18:34:40 +01:00
2009-06-18 13:03:57 -07:00
2009-06-16 19:50:13 -07:00
2009-06-22 21:29:52 -07:00
2009-06-17 09:35:24 -07:00
2009-06-19 16:46:03 -07:00
Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
2009-06-24 01:19:50 -04:00
2009-06-15 21:30:25 -07:00
2009-06-16 19:50:13 -07:00
2009-06-24 00:18:56 +01:00
2009-06-21 22:48:03 -07:00
2009-05-28 20:52:40 -04:00
2009-06-22 21:29:52 -07:00
2009-06-13 23:36:29 -07:00
2009-06-23 10:38:47 -07:00
2009-06-20 10:17:02 -07:00
2009-08-02 12:59:32 -07:00
2009-06-12 09:32:26 -07:00
2009-06-16 11:29:17 -07:00
2009-06-22 10:12:37 +01:00
2009-06-23 03:29:57 -03:00
2009-06-22 08:54:14 -05:00
2009-06-20 18:39:43 +00:00
2009-06-18 13:04:04 -07:00
2009-06-21 21:01:00 +02:00
2009-06-22 16:56:22 -07:00
2009-08-03 16:31:22 -04:00
2009-07-22 09:27:18 -07:00
2009-06-15 21:30:28 -07:00
2009-06-22 11:29:00 -07:00
2009-06-24 10:17:07 -07:00
2009-06-16 19:50:13 -07:00
2009-07-21 15:58:54 -04:00
Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
2009-06-24 01:19:50 -04:00
2009-06-09 01:12:38 +04:00
2009-06-18 13:04:04 -07:00
2009-06-15 16:47:25 +10:00
2009-06-15 21:45:32 -05:00
2009-06-15 11:18:27 +01:00
2009-06-19 16:46:05 -07:00
2009-06-22 12:08:23 +02:00
2009-06-16 04:56:57 -07:00
2009-07-30 11:05:03 -07:00
2009-06-24 09:55:50 -07:00
2009-06-12 01:34:12 +03:00
2009-06-19 16:46:05 -07:00
2009-07-08 15:24:25 -04:00
2009-06-24 18:34:41 +01:00
2009-06-15 21:30:27 -07:00
2009-06-18 11:16:55 +10:00
2009-06-01 12:03:15 +01:00
2009-06-23 12:50:05 -07:00
2009-06-12 22:16:40 +09:30
2009-06-16 19:47:52 -07:00
2009-06-24 14:35:57 -07:00
2009-06-23 07:13:52 +00:00
2009-06-12 21:32:31 +02:00
2009-06-18 13:04:04 -07:00
2009-06-18 13:04:04 -07:00