kernel-fxtec-pro1x/drivers
Julia Lawall e2bde78713 mfd: Fix davinci memory leak
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,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: Samuel Ortiz <sameo@linux.intel.com>
2010-08-12 11:27:20 +02:00
..
accessibility
acpi
amba
ata Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-08-11 09:13:19 -07:00
atm Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-08-09 21:05:52 -07:00
auxdisplay
base drivers/base/node.c: reduce stack usage of node_read_meminfo() 2010-08-09 20:45:02 -07:00
block Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block 2010-08-10 15:22:42 -07:00
bluetooth
cdrom
char kfifo: fix kfifo miss use of nozami.c 2010-08-11 08:59:23 -07:00
clocksource
connector
cpufreq
cpuidle cpuidle: extend cpuidle and menu governor to handle dynamic states 2010-08-09 20:45:04 -07:00
crypto Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 2010-08-11 09:17:27 -07:00
dca
dio
dma Merge branches 'master' and 'devel' into for-linus 2010-08-10 23:17:52 +01:00
edac edac: mpc85xx: add support for new MPCxxx/Pxxxx EDAC controllers 2010-08-11 08:59:21 -07:00
eisa
firewire
firmware edd: fix possible memory leak in edd_init() error path 2010-08-09 20:45:09 -07:00
gpio gpio: sx150x: add Semtech I2C sx150x gpio expander driver 2010-08-11 08:59:09 -07:00
gpu vt/console: try harder to print output when panicing 2010-08-10 13:47:40 -07:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2010-08-10 15:08:02 -07:00
hwmon fix "hwmon: coretemp: update hotplug condition check" 2010-08-11 08:58:59 -07:00
i2c Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable 2010-08-09 14:07:19 +01:00
ide Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block 2010-08-10 15:22:42 -07:00
idle
ieee1394
ieee802154
infiniband
input panic: keep blinking in spite of long spin timer mode 2010-08-11 08:59:22 -07:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2010-08-09 21:05:52 -07:00
leds
lguest
macintosh
mca
md Merge branch 'for-linus' of git://neil.brown.name/md 2010-08-10 15:38:19 -07:00
media Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6 2010-08-10 15:09:54 -07:00
memstick
message fusion: fix kernel-doc warnings 2010-08-11 08:59:12 -07:00
mfd mfd: Fix davinci memory leak 2010-08-12 11:27:20 +02:00
misc cs5535-mfgpt: reuse timers that have never been set up 2010-08-11 08:59:20 -07:00
mmc mmc: add ricoh e822 pci id 2010-08-11 08:59:05 -07:00
mtd mtd/nand_base: fix kernel-doc warnings & typos 2010-08-11 08:59:18 -07:00
net Merge branch 'ixp4xx' of git://git.kernel.org/pub/scm/linux/kernel/git/chris/linux-2.6 2010-08-11 09:17:27 -07:00
nubus
of
oprofile
parisc
parport parport_serial: use the PCI IRQ if offered 2010-08-11 08:59:22 -07:00
pci Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx 2010-08-09 21:00:07 -07:00
pcmcia Merge branches 'master' and 'devel' into for-linus 2010-08-10 23:17:52 +01:00
platform
pnp
power Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-08-11 09:13:19 -07:00
pps
ps3
rapidio
regulator
rtc Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-08-11 09:13:19 -07:00
s390 Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block 2010-08-10 15:22:42 -07:00
sbus
scsi scsi: 53c700: remove dma_is_consistent usage 2010-08-11 08:59:21 -07:00
serial Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2010-08-11 09:13:19 -07:00
sfi
sh
sn
spi
ssb
staging Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block 2010-08-10 15:22:42 -07:00
tc
telephony
thermal
uio
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6 2010-08-10 15:05:02 -07:00
uwb
vhost
video Merge branch 'msm-video' of git://codeaurora.org/quic/kernel/dwalker/linux-msm 2010-08-11 09:18:06 -07:00
virtio
vlynq
w1
watchdog watchdog: hpwdt: formatting of pointers in printk() 2010-08-08 18:22:44 +00:00
xen Merge branch 'for-2.6.36' of git://git.kernel.dk/linux-2.6-block 2010-08-10 15:22:42 -07:00
zorro zorro: Fix reading of proc/bus/zorro/* in small chunks 2010-08-09 21:14:08 +02:00
Kconfig
Makefile