linux/drivers/video/backlight
Julia Lawall c0d861afa5 drivers/video/backlight/da903x.c: introduce missing kfree
Error handling code following a kzalloc 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>
Cc: Mike Rapoport <mike@compulab.co.il>
Cc: Richard Purdie <rpurdie@linux.intel.com>
Cc: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-11-19 18:49:59 -08:00
..
atmel-pwm-bl.c fbdev: LCD backlight driver using Atmel PWM driver 2008-07-24 10:47:41 -07:00
backlight.c backlight: Fix missing kernel doc entry 2008-07-23 09:50:18 +01:00
corgi_bl.c backlight: Convert corgi backlight driver into a more generic driver 2007-10-11 22:24:13 +01:00
corgi_lcd.c [ARM] corgi_lcd: fix simultaneous compilation with corgi_bl 2008-10-29 11:45:37 +08:00
cr_bllcd.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
da903x.c drivers/video/backlight/da903x.c: introduce missing kfree 2008-11-19 18:49:59 -08:00
hp680_bl.c sh: Migrate common board headers to mach-common/. 2008-10-20 13:02:48 +09:00
ili9320.c fb: add support for the ILI9320 video display controller 2008-07-24 10:47:40 -07:00
ili9320.h fb: add support for the ILI9320 video display controller 2008-07-24 10:47:40 -07:00
kb3886_bl.c backlight: Add driver for Tabletkiosk Sahara TouchIT-213 Tablet PC 2008-10-21 00:19:49 +01:00
Kconfig Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-23 16:06:49 -07:00
lcd.c lcd: fix oops if driver only interested in .set_power 2008-11-19 18:49:58 -08:00
locomolcd.c [ARM] 4250/1: Fix locomo backlight conversion error/compile failure 2007-03-08 13:34:01 +00:00
ltv350qv.c backlight: Add Samsung LTV350QV LCD driver 2007-10-11 22:24:12 +01:00
ltv350qv.h backlight: Add Samsung LTV350QV LCD driver 2007-10-11 22:24:12 +01:00
Makefile backlight: Add driver for Tabletkiosk Sahara TouchIT-213 Tablet PC 2008-10-21 00:19:49 +01:00
mbp_nvidia_bl.c Fix autoloading of MacBook Pro backlight driver. 2008-10-13 16:05:46 +01:00
omap1_bl.c [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
platform_lcd.c backlight: ensure platform_lcd on by default 2008-07-30 09:41:44 -07:00
progear_bl.c fbdev: change asm/uaccess.h to linux/uaccess.h 2007-10-16 09:43:17 -07:00
pwm_bl.c backlight: add MODULE_ALIAS() to pwm_backlight driver 2008-08-05 14:33:48 -07:00
tdo24m.c lcd: add support for Toppoly TDO24M series LCD panels 2008-09-23 22:04:31 +01:00
tosa_bl.c backlight: add support for Sharp SL-6000 LCD and backlight drivers 2008-10-21 00:19:49 +01:00
tosa_lcd.c backlight: add support for Sharp SL-6000 LCD and backlight drivers 2008-10-21 00:19:49 +01:00
vgg2432a4.c fb: add support for the ILI9320 video display controller 2008-07-24 10:47:40 -07:00