kernel_optimize_test/drivers/mfd
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
..
88pm860x-core.c mfd: Fix 88pm860x uninitialized variable and clean up 2010-08-12 11:27:18 +02:00
88pm860x-i2c.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
ab3100-core.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
ab3100-otp.c mfd: Fix memory leak in ab3100_otp_probe 2010-08-12 11:27:17 +02:00
ab3550-core.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
ab8500-core.c mfd: New AB8500 driver 2010-05-28 01:38:00 +02:00
ab8500-spi.c mfd: AB8500 mask off irrelevant bits from the SPI message 2010-08-12 11:27:18 +02:00
abx500-core.c mfd: kzalloc doesn't return ERR_PTR 2010-08-12 11:27:19 +02:00
adp5520.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
asic3.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
da903x.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
davinci_voicecodec.c mfd: Fix davinci memory leak 2010-08-12 11:27:20 +02:00
dm355evm_msp.c
ezx-pcap.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
htc-egpio.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
htc-i2cpld.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
htc-pasic3.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
janz-cmodio.c mfd: Janz CMOD-IO PCI MODULbus Carrier Board support 2010-05-28 01:37:32 +02:00
Kconfig mfd: New AB8500 driver 2010-05-28 01:38:00 +02:00
lpc_sch.c mfd: Introduce lpc_sch for Intel SCH LPC bridge 2010-03-07 22:17:22 +01:00
Makefile mfd: New AB8500 driver 2010-05-28 01:38:00 +02:00
max8925-core.c mfd: Enable onkey on max8925 2010-08-12 11:27:16 +02:00
max8925-i2c.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
mc13783-core.c leds: Add mc13783 LED support 2010-05-26 13:07:56 +01:00
mcp-core.c
mcp-sa11x0.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
menelaus.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
mfd-core.c mfd: properly handle platform_device_add_resources fail in mfd_add_device 2010-08-12 11:27:19 +02:00
pcf50633-adc.c mfd: pcf50633-adc: Fix potential race in pcf50633_adc_sync_read 2010-05-28 01:37:49 +02:00
pcf50633-core.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
pcf50633-gpio.c
pcf50633-irq.c mfd: Move pcf50633 irq related functions to its own file. 2010-05-28 01:37:50 +02:00
rdc321x-southbridge.c mfd: Change rdc321x resources flags to IORESOURCE_IO 2010-05-28 01:37:52 +02:00
sh_mobile_sdhi.c sh: allow platforms to specify SD-card supported voltages 2010-05-22 17:05:22 +09:00
sm501.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
t7l66xb.c mfd: Check t7l66 platform_data pointer 2010-05-28 01:37:26 +02:00
tc6387xb.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tc6393xb.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
tc35892.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
timberdale.c mfd: Storage class for timberdale should be before const qualifier 2010-05-28 01:38:01 +02:00
timberdale.h mfd: Add timb-dma to all configurations of timberdale 2010-05-28 01:37:31 +02:00
tmio_core.c mfd: tmio_mmc hardware abstraction for CNF area 2010-01-18 12:30:27 +01:00
tps6507x.c input: Touchscreen driver for TPS6507x 2010-05-28 01:37:38 +02:00
tps65010.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
twl4030-codec.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
twl4030-irq.c mfd: Rename twl5031 sih modules 2010-05-28 01:38:02 +02:00
twl4030-power.c mfd: Introduce remove_script function for twl4030 2010-03-07 22:17:32 +01:00
twl6030-irq.c mfd: Add support for twl6030 irq framework 2009-12-14 00:25:31 +01:00
twl-core.c OMAP4: PMIC: Rename twl6030_codec as twl6040_codec 2010-03-18 17:04:55 +00:00
ucb1x00-assabet.c
ucb1x00-core.c mfd: Fix ucb1x00 build failure for collie_defconfig 2010-03-07 22:17:39 +01:00
ucb1x00-ts.c
ucb1400_core.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
wm831x-core.c mfd: Ensure WM831x charger interrupts are acknowledged when suspending 2010-05-28 01:37:39 +02:00
wm831x-irq.c mfd: Initialise WM831x IRQ masks on chip even if interrupts not in use 2010-05-28 01:37:38 +02:00
wm831x-otp.c
wm8350-core.c mfd: Clean up after WM83xx AUXADC interrupt if it arrives late 2010-05-13 12:58:55 +02:00
wm8350-gpio.c
wm8350-i2c.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
wm8350-irq.c mfd: Convert WM8350 to genirq 2010-03-07 22:16:57 +01:00
wm8350-regmap.c mfd: Remove build time warning for WM835x register default tables 2009-12-13 19:21:53 +01:00
wm8400-core.c i2c: Remove all i2c_set_clientdata(client, NULL) in drivers 2010-06-03 11:33:58 +02:00
wm8994-core.c Merge branch 'topic/asoc' into for-linus 2010-05-20 12:00:43 +02:00
wm8994-irq.c mfd: Add WM8994 interrupt controller support 2010-04-05 19:18:07 +01:00