linux/sound/soc
Julia Lawall 880b8ffd45 ASoC: pl022_ds.c: Add of_node_put to avoid memory leak
Add a call to of_node_put in the error handling code following a call to
of_parse_phandle.

This patch also moves the existing call to of_node_put tothe end of the
error handling code, to make it possible to jump to of_node_put without
doing the other cleanup operations.  These appear to be disjoint
operations, so the ordering doesn't matter.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
local idexpression x;
expression E,E1,E2;
statement S;
@@

*x =
(of_find_node_by_path
|of_find_node_by_name
|of_find_node_by_phandle
|of_get_parent
|of_get_next_parent
|of_get_next_child
|of_find_compatible_node
|of_match_node
|of_find_node_by_type
|of_find_node_with_property
|of_find_matching_node
|of_parse_phandle
)(...);
...
if (x == NULL) S
<... when != x = E
*if (...) {
  ... when != of_node_put(x)
      when != if (...) { ... of_node_put(x); ... }
(
  return <+...x...+>;
|
*  return ...;
)
}
...>
(
E2 = x;
|
of_node_put(x);
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@slimlogic.uo.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-02 16:28:49 +01:00
..
atmel ASoC: Add simplfied device registration for Atmel SSC devices 2010-08-18 16:53:22 +01:00
au1x ASoC: fix au1x platform 2010-08-31 13:06:31 +01:00
blackfin Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37 2010-08-15 14:56:40 +01:00
codecs ASoC: Added a missing 32-bit PCM format, to the wm8994 codec. 2010-09-01 12:45:51 +01:00
davinci ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
ep93xx ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
fsl ASoC: pl022_ds.c: Add of_node_put to avoid memory leak 2010-09-02 16:28:49 +01:00
imx Merge branch 'for-2.6.36' into for-2.6.37 2010-08-23 13:38:11 +01:00
jz4740 ASoC: Multi-component: JZ4740: QI_LB60 board fixes 2010-08-17 12:10:30 +01:00
kirkwood ASoC: kirkwood: add alias to pcm module 2010-09-02 16:27:59 +01:00
nuc900 ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
omap ASoC: Use a more adequate name for the CX20442 codec DAI 2010-08-19 15:30:43 +01:00
pxa ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove() 2010-08-25 14:20:15 +01:00
s3c24xx ASoC: Add HP iPAQ RX1950 support 2010-08-31 13:25:17 +01:00
s6000 ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
sh ASoC: fsi-codec: Add FSI - HDMI support 2010-09-01 11:18:09 +01:00
txx9 ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
Kconfig ASoC: Fix sorting of Makefile and Kconfig 2010-07-05 23:35:29 +09:00
Makefile ASoC: Fix sorting of Makefile and Kconfig 2010-07-05 23:35:29 +09:00
soc-cache.c Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37 2010-08-15 14:56:40 +01:00
soc-core.c Merge branch 'for-2.6.36' into for-2.6.37 2010-08-27 20:10:22 +01:00
soc-dapm.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
soc-jack.c ASoC: multi-component - ASoC Multi-Component Support 2010-08-12 14:00:00 +01:00
soc-utils.c ASoC: Add BCLK calculation utility for TDM mode too 2009-11-25 19:55:46 +00:00