kernel_optimize_test/sound/soc/fsl
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
..
efika-audio-fabric.c ASoC: Fabric bindings for STAC9766 on the Efika 2009-05-26 21:13:02 +01:00
fsl_dma.c ASoC: fsl_dma: Pass the proper device for dma mapping routines 2009-04-06 23:35:42 +01:00
fsl_dma.h ALSA: asoc: fsl - merge structs snd_soc_codec_dai and snd_soc_cpu_dai. 2008-07-10 09:32:40 +02:00
fsl_ssi.c ASoC: Switch FSL SSI DAI over to symmetric_rates 2009-05-27 11:12:45 +01:00
fsl_ssi.h ASoC: add support for SSI asynchronous mode to the Freescale SSI drivers 2009-03-06 13:37:16 +00:00
Kconfig ASoC: remove BROKEN from Efika and pcm030 fabric drivers 2009-06-30 10:23:41 +01:00
Makefile ASoC: Fabric bindings for STAC9766 on the Efika 2009-05-26 21:13:02 +01:00
mpc5200_dma.c ASoC: Clean up error handling in MPC5200 DMA setup 2009-09-12 13:41:50 +01:00
mpc5200_dma.h ASoC: add locking to mpc5200-psc-ac97 driver 2009-07-03 10:41:47 +01:00
mpc5200_psc_ac97.c ASoC: MPC5200: Increase the delay time between resets 2009-07-22 00:07:51 +01:00
mpc5200_psc_ac97.h ASoC: AC97 driver for mpc5200 2009-05-26 21:13:00 +01:00
mpc5200_psc_i2s.c ASoC: Main rewite of the mpc5200 audio DMA code 2009-05-26 21:12:50 +01:00
mpc5200_psc_i2s.h ASoC: Main rewite of the mpc5200 audio DMA code 2009-05-26 21:12:50 +01:00
mpc8610_hpcd.c ASoC: add support for SSI asynchronous mode to the Freescale SSI drivers 2009-03-06 13:37:16 +00:00
pcm030-audio-fabric.c ASoC: Support for AC97 on Phytec pmc030 base board. 2009-05-26 21:13:01 +01:00
soc-of-simple.c ASoC: Push platform registration down into the card 2008-12-02 16:03:40 +00:00