]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: keep pointer to resource so it can be freed
authorJulia Lawall <julia@diku.dk>
Tue, 18 Oct 2011 15:06:39 +0000 (17:06 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 22 Oct 2011 09:46:35 +0000 (10:46 +0100)
commitce3d15473951f402f7c9d88231d6dd6523ef7c08
treec85786a71a405d3c1a1c0d96a685d460d9d649d5
parente8c07af61226c84382e06fae1f7e5c7ac44e0ad2
ASoC: keep pointer to resource so it can be freed

Add a new variable for storing resources accessed subsequent to the one
accessed using request_mem_region, so the one accessed using
request_mem_region can be released if needed.

The resource variable names are also changed to be more descriptive.

This code is also missing some calls to iounmap.

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

// <smpl>
@r@
expression E, E1;
identifier f;
statement S1,S2,S3;
@@

if (E == NULL)
{
  ... when != if (E == NULL || ...) S1 else S2
      when != E = E1
*E->f
  ... when any
  return ...;
}
else S3
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/au1x/ac97c.c
sound/soc/au1x/i2sc.c
sound/soc/au1x/psc-ac97.c
sound/soc/au1x/psc-i2s.c
sound/soc/mxs/mxs-saif.c