aha/drivers/staging
Julia Lawall e281cf8966 Staging: batman-adv: 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>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-23 11:27:50 -08:00
..
altpciechdma
arlan
asus_oled
b3dfg
batman-adv Staging: batman-adv: introduce missing kfree 2009-12-23 11:27:50 -08:00
comedi Staging: comedi: jr3_pci: Don't ioremap too much space. Check result. 2009-12-23 11:27:46 -08:00
cx25821 V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignments 2009-12-16 00:17:57 -02:00
dream Staging: dream: add gpio and pmem support 2009-12-11 12:23:21 -08:00
echo
et131x Staging: et131x: clean up the avail fields in the rx registers 2009-12-11 12:23:21 -08:00
frontier
go7007 V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignments 2009-12-16 00:17:57 -02:00
hv
iio drop explicit include of autoconf.h 2009-12-12 13:08:15 +01:00
line6
mimio
netwave
octeon Staging: octeon-ethernet: Convert to use PHY Abstraction Layer. 2009-12-17 01:57:00 +00:00
otus
p9auth
panel Staging: panel: Adjust range for PANEL_KEYPAD in Kconfig 2009-12-23 11:27:49 -08:00
phison
poch
pohmelfs pohmelfs needs I_LOCK 2009-12-22 12:27:33 -05:00
quatech_usb2
ramzswap Staging: ramzswap: remove ARM specific d-cache hack 2009-12-23 11:27:49 -08:00
rar
rt2860
rt2870
rt3070
rt3090
rtl8187se Staging: fix rtl8187se compilation errors with mac80211 2009-12-23 11:27:46 -08:00
rtl8192e Staging: rtl8192x: fix printk formats 2009-12-23 11:27:48 -08:00
rtl8192su staging: rtl8192su: add USB VID/PID for HWNUm-300 2009-12-23 11:27:47 -08:00
rtl8192u Staging: rtl8192x: fix printk formats 2009-12-23 11:27:48 -08:00
samsung-laptop Staging: samsung-laptop: add TODO file 2009-12-11 12:23:23 -08:00
sep
serqt_usb2
slicoss
sm7xx Staging: sm7xx: add a new framebuffer driver 2009-12-23 11:27:44 -08:00
strip
udlfb
usbip
vme
vt6655
vt6656
wavelan
winbond
wlags49_h2 Staging: wlags49_h2: fix up signal levels 2009-12-11 12:23:23 -08:00
wlags49_h25
wlan-ng Staging: wlan-ng: fix Correct size given to memset 2009-12-23 11:27:48 -08:00
Kconfig Staging: dst: remove from the tree 2009-12-23 11:27:45 -08:00
Makefile Staging: dst: remove from the tree 2009-12-23 11:27:45 -08:00
staging.c