linux/sound
Julia Lawall 33d7f77850 ASoC: Clean up error handling in MPC5200 DMA setup
Error handling code following a kzalloc should free the allocated data.
Error handling code following an ioremap should iounmap the allocated data.

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>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-12 13:41:50 +01:00
..
aoa sound: remove driver_data direct access of struct device 2009-05-12 09:20:54 +02:00
arm ASoC: fix pxa2xx-ac97.c breakage 2009-09-04 20:19:56 +01:00
atmel ALSA: snd-atmel-abdac: increase periods_min to 6 instead of 4 2009-04-06 03:56:28 +02:00
core Merge branch 'topic/seq-midi-fix' into for-linus 2009-06-22 17:03:56 +02:00
drivers time: move PIT_TICK_RATE to linux/timex.h 2009-06-16 19:47:27 -07:00
i2c V4L/DVB (10771): tea575x-tuner: convert it to V4L2 API 2009-03-30 12:43:02 -03:00
isa Merge branch 'topic/seq-kconfig-cleanup' into for-linus 2009-06-10 07:26:48 +02:00
mips ALSA: sgio2audio.c: clean up checking 2009-06-07 09:08:43 +02:00
oss time: move PIT_TICK_RATE to linux/timex.h 2009-06-16 19:47:27 -07:00
parisc Merge branch 'topic/section-fix' into for-linus 2009-06-10 07:26:46 +02:00
pci Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2009-06-23 10:45:39 -07:00
pcmcia ALSA: Add missing SNDRV_PCM_INFO_BATCH flag to some drivers 2009-04-28 15:06:44 +02:00
ppc Merge branch 'topic/ps3' into for-linus 2009-06-12 20:03:16 +02:00
sh trivial: Fix misspelling of firmware 2009-03-30 15:21:59 +02:00
soc ASoC: Clean up error handling in MPC5200 DMA setup 2009-09-12 13:41:50 +01:00
sparc ALSA: Add missing SNDRV_PCM_INFO_BATCH flag to some drivers 2009-04-28 15:06:44 +02:00
spi ALSA: Convert to snd_card_create() in other sound/* 2009-01-12 15:21:19 +01:00
synth ALSA: clean up the logic for building sequencer modules 2009-05-29 11:49:42 +02:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 2009-06-21 13:13:08 -07:00
ac97_bus.c ALSA: ac97 - Include ac97_codec.h for ac97_bus_type declaration 2008-12-02 16:25:37 +01:00
Kconfig ALSA: Add Atmel ALSA drivers directory 2009-02-05 15:08:53 +01:00
last.c
Makefile ALSA: Add Atmel ALSA drivers directory 2009-02-05 15:08:53 +01:00
sound_core.c Driver Core: sound: add nodename for sound drivers 2009-06-15 21:30:26 -07:00
sound_firmware.c