linux/sound/pci
Julia Lawall d6f35e3f0d ALSA: sound/pci/pcxhr/pcxhr.c: introduce missing kfree and pci_disable_device
Error handling code following a kzalloc should free the allocated data.
The error handling code is adjusted to call pci_disable_device(pci); as
well, as done later in the function

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>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-11-15 19:07:29 +01:00
..
ac97 sound: struct device - replace bus_id with dev_name(), dev_set_name() 2008-10-30 07:32:31 +01:00
ali5451 [ALSA] Fix synchronize_irq() bugs, redundancies 2008-04-24 12:00:40 +02:00
au88x0 ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
aw2 ALSA: aw2 - Fix Oops at initialization 2008-06-23 12:06:23 +02:00
ca0106 ALSA: misc typo fixes 2008-10-19 10:36:08 +02:00
cs46xx ALSA: cs46xx: Add PCI IDs for TerraTec and Hercules cards 2008-10-10 13:41:44 +02:00
cs5535audio [ALSA] fix cs5535 section mismatch 2008-01-31 17:30:12 +01:00
echoaudio ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
emu10k1 ALSA: emu10k1 - Add more invert_shared_spdif flag to Audigy models 2008-11-03 10:21:36 +01:00
hda ALSA: hda: corrected invalid mixer values 2008-10-13 02:22:08 +02:00
ice1712 ALSA: sound/ice1712: indentation & braces disagree - add braces 2008-10-30 12:11:24 +01:00
korg1212 ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
mixart ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
nm256 ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
oxygen ALSA: oxygen: wait for ACK when resetting UART 2008-09-24 15:25:28 +02:00
pcxhr ALSA: sound/pci/pcxhr/pcxhr.c: introduce missing kfree and pci_disable_device 2008-11-15 19:07:29 +01:00
riptide ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
rme9652 ALSA: hdsp: check for iobox and upload firmware during ioctl 2008-11-09 12:55:18 +01:00
trident ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
vx222 ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
ymfpci ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
ad1889.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
ad1889.h
ak4531_codec.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
als300.c [ALSA] sound: replace remaining __FUNCTION__ occurences 2008-04-24 12:00:20 +02:00
als4000.c ALSA: ALS4000 driver work, step 2 2008-08-25 09:57:48 +02:00
atiixp_modem.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
atiixp.c ALSA: atiixp - Add PCI ID for SB600 (1002:4382) 2008-09-04 10:26:36 +02:00
azt3328.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
azt3328.h ALSA: sound/pci/azt3328.h: no variables for enums 2008-07-27 10:22:25 +02:00
bt87x.c ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
cmipci.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
cs4281.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
cs5530.c sound: use a common working email address 2008-10-27 16:36:30 +01:00
ens1370.c ALSA: ALSA: ens1370: communicate PCI device to AC97 2008-07-17 14:29:55 +02:00
ens1371.c
es1938.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
es1968.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
fm801.c [ALSA] sound: fm801.c fix shadowed variable warning 2008-04-24 12:00:16 +02:00
intel8x0.c ALSA: intel8x0 - add Dell Optiplex GX620 (AD1981B) to AC97 clock whitelist 2008-10-29 15:12:00 +01:00
intel8x0m.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
Kconfig ALSA: Support NVIDIA MCP78/7A HDMI audio 2008-10-10 13:41:35 +02:00
maestro3.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
Makefile [ALSA] Make ak4531 local to ens1370 driver 2008-05-30 09:26:09 +02:00
rme32.c [ALSA] sound: rme32.c fix integer as NULL pointer warning 2008-04-24 12:00:16 +02:00
rme96.c [ALSA] sound: rme96.c fix integer as NULL pointer warning 2008-04-24 12:00:17 +02:00
sis7019.c [ALSA] Fix synchronize_irq() bugs, redundancies 2008-04-24 12:00:40 +02:00
sis7019.h [ALSA] sis7019: support the SiS 7019 Audio Accelerator 2008-01-31 17:29:36 +01:00
sonicvibes.c ALSA: Kill snd_assert() in sound/pci/* 2008-08-13 11:46:38 +02:00
via82xx_modem.c ALSA: Clean up SG-buffer helper functions and macros 2008-08-25 09:57:18 +02:00
via82xx.c ALSA: via82xx - check continuous pages in buffer setup 2008-08-25 09:57:43 +02:00