kernel-fxtec-pro1x/drivers/staging/go7007
Julia Lawall 253d3b139a Staging: go7007: introduce missing kfree
Error handling code following a kmalloc should 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,l;
position p1,p2;
expression *ptr != NULL;
@@

(
if ((x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...)) == NULL) S
|
x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
...
if (x == NULL) S
)
<... when != x
     when != if (...) { <+...x...+> }
x->f = E
...>
(
 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: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:27 -07:00
..
go7007-driver.c Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
go7007-fw.c Staging: go7007: annotate code pointers 2009-01-06 13:52:06 -08:00
go7007-i2c.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
go7007-priv.h Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
go7007-usb.c Staging: go7007: small cleanup 2009-01-06 13:52:07 -08:00
go7007-v4l2.c V4L/DVB (10176a): Switch remaining clear_user_page users over to clear_user_highpage 2009-01-07 22:18:54 -02:00
go7007.h Staging: add the go7007 video driver 2008-10-10 15:31:08 -07:00
go7007.txt Staging: go7007: saa7134 updates 2009-01-06 13:52:06 -08:00
Kconfig Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
Makefile Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
README Staging: add the go7007 video driver 2008-10-10 15:31:08 -07:00
s2250-board.c Staging: go7007: introduce missing kfree 2009-04-03 14:53:27 -07:00
s2250-loader.c Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
saa7134-go7007.c Staging: go7007: saa7134 updates 2009-01-06 13:52:06 -08:00
snd-go7007.c drivers/staging: Convert to snd_card_create() for go7007 2009-01-12 15:25:11 +01:00
wis-i2c.h Staging: go7007: add sensoray 2250/2251 support 2009-01-06 13:52:06 -08:00
wis-ov7640.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
wis-saa7113.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
wis-saa7115.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
wis-sony-tuner.c Staging: go7007: saa7134 updates 2009-01-06 13:52:06 -08:00
wis-tw2804.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
wis-tw9903.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00
wis-uda1342.c Staging: go7007: remove unused #include <version.h> 2008-10-22 09:56:31 -07:00

Todo:
	- checkpatch.pl cleanups
	- sparse cleanups
	- lots of little modules, should be merged together
	  and added to the build.
	- testing?
	- handle churn in v4l layer.

Please send patchs to Greg Kroah-Hartman <greg@kroah.com> and Cc: Ross
Cohen <rcohen@snurgle.org> as well.