2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-26 14:14:01 +08:00
linux-next/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 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
arlan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6 2009-12-08 07:55:01 -08:00
asus_oled Staging: asus_oled: Cleaned up checkpatch issues. 2009-09-15 12:02:33 -07:00
b3dfg Staging: b3dfg: remove check for pci bus master 2009-12-11 12:21:46 -08:00
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 Staging: echo: coding style cleanups 2009-09-15 12:02:16 -07:00
et131x Staging: et131x: clean up the avail fields in the rx registers 2009-12-11 12:23:21 -08:00
frontier Staging: remove unused #include <linux/version.h>'s 2009-06-19 11:00:36 -07:00
go7007 V4L/DVB (13556): v4l: Remove unneeded video_device::minor assignments 2009-12-16 00:17:57 -02:00
hv Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
iio drop explicit include of autoconf.h 2009-12-12 13:08:15 +01:00
line6 staging: line6: Convert simple_strtoul to strict_strtoul in midi.c 2009-12-11 12:21:48 -08:00
mimio Staging: mimio: depends on INPUT 2009-04-03 14:53:29 -07:00
netwave Merge branch 'master' of /home/davem/src/GIT/linux-2.6/ 2009-12-05 15:22:26 -08:00
octeon Staging: octeon-ethernet: Convert to use PHY Abstraction Layer. 2009-12-17 01:57:00 +00:00
otus Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
p9auth Staging: p9auth: adding __init/__exit macros 2009-12-11 12:23:04 -08:00
panel Staging: panel: Adjust range for PANEL_KEYPAD in Kconfig 2009-12-23 11:27:49 -08:00
phison Staging: phison: adding __init/__exit macros 2009-12-11 12:23:05 -08:00
poch Staging: poch: Add sample Rx code 2009-12-11 12:23:09 -08:00
pohmelfs pohmelfs needs I_LOCK 2009-12-22 12:27:33 -05:00
quatech_usb2 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
ramzswap Staging: ramzswap: remove ARM specific d-cache hack 2009-12-23 11:27:49 -08:00
rar Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
rt2860 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
rt2870 Staging: rt28x0: Add proper selection of WIRELESS_EXT and WEXT_PRIV 2009-12-11 12:23:16 -08:00
rt3070 Staging: rt28x0: remove typedefs (part one) 2009-12-11 12:23:15 -08:00
rt3090 Staging: rt28x0: remove typedefs (part one) 2009-12-11 12:23:15 -08:00
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 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
serqt_usb2 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
slicoss Staging: slicoss: remove duplicate structure field initialization 2009-12-11 12:23:05 -08:00
sm7xx Staging: sm7xx: add a new framebuffer driver 2009-12-23 11:27:44 -08:00
strip Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 2009-11-09 11:17:24 -08:00
udlfb Staging: udlfb: fix printk format warning 2009-09-15 12:02:06 -07:00
usbip Staging: usbip: Fix typo "Contoroller". 2009-12-11 12:23:19 -08:00
vme staging: vme: Fix mutex locking 2009-12-11 12:23:18 -08:00
vt6655 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
vt6656 Staging: fix assorted typos all over the place 2009-12-11 12:23:20 -08:00
wavelan Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2009-12-09 19:43:33 -08:00
winbond Staging: wireless drivers Kconfig change 2009-10-30 14:47:44 -07:00
wlags49_h2 Staging: wlags49_h2: fix up signal levels 2009-12-11 12:23:23 -08:00
wlags49_h25 Staging: wlags49: fix kconfigs dependancy 2009-12-11 12:23:10 -08:00
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