1
linux/sound/soc
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
..
atmel ASoC: Configure WM8731 SYSCLK at startup on AT91SAM9G20-EK 2009-07-08 18:41:05 +01:00
au1x ASoC: au1x: PSC-AC97 bugfixes 2009-09-08 19:21:27 +01:00
blackfin ASoC: new board driver to connect bfin-5xx with ad1836 codec 2009-09-01 11:36:13 +01:00
codecs ASoC: Fix WM835x Out4 capture enumeration 2009-09-07 18:56:24 +01:00
davinci ASoC: davinci: i2c device creation moved into board files 2009-08-28 10:33:10 +01:00
fsl ASoC: Clean up error handling in MPC5200 DMA setup 2009-09-12 13:41:50 +01:00
imx ASoC: Staticise unexported variables 2009-08-15 11:36:49 +01:00
omap ASoC: OMAP: Add functionality to set CLKR and FSR sources in McBSP DAI 2009-08-28 18:36:43 +01:00
pxa ASoC: Pass correct platform data from pxa2xx-ac97 2009-08-23 18:18:01 +01:00
s3c24xx ASoC: Fix s3c-i2s-v2 build 2009-08-26 15:27:57 +01:00
s6000 ASoC: tlv320aic3x: fixup board device changes 2009-08-21 10:52:57 +01:00
sh ASoC: Add FSI-AK4642 sound support for SuperH 2009-08-21 11:02:03 +01:00
txx9 ASoC: txx9aclc: dynamically allocate dmaengine devname 2009-06-25 21:06:30 +01:00
Kconfig ASoC: Hook i.MX into build 2009-08-15 11:37:30 +01:00
Makefile Merge branch 'for-2.6.32' into mxc 2009-08-15 11:20:44 +01:00
soc-cache.c ASoC: fix I2C build errors 2009-08-11 10:47:25 +01:00
soc-core.c ASoC: Add DAPM widget power decision debugfs files 2009-08-21 17:17:59 +01:00
soc-dapm.c Merge branch 'topic/digital-mixing' into for-2.6.32 2009-08-24 20:44:41 +01:00
soc-jack.c ASoC: jack: Fix race in snd_soc_jack_add_gpios 2009-07-31 22:38:43 +01:00