alistair23-linux/sound/soc
Jesper Juhl c83f1d7e71 ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error
In wm2000_i2c_probe(), if we take the true branch in

"
  ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_wm2000,
                               NULL, 0);
  if (ret != 0)
          goto err_fw;
"

then we'll release_firmware(fw) at the 'err_fw' label. But we've already
done that just a few lines above. That's a use-after-free bug.

This patch restructures the code so that we always call
release_firmware(fw) before leaving the function, but only ever call
it once.
This means that we have to initialize 'fw' to NULL since some paths
may now end up calling it without having called request_firmware(),
but since request_firmware() deals gracefully with NULL pointers, we
are fine if we just NULL initialize it.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-24 11:34:19 +00:00
..
atmel ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC 2012-01-10 14:52:20 -08:00
au1x Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2012-01-14 13:05:21 -08:00
blackfin ASoC: check for substream not channels_min in pcm engines 2012-01-07 11:18:05 -08:00
codecs ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error 2012-01-24 11:34:19 +00:00
davinci ASoC: check for substream not channels_min in pcm engines 2012-01-07 11:18:05 -08:00
ep93xx Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
fsl ASoC: fsl: Add .owner to struct snd_soc_card 2011-12-22 17:34:32 +00:00
imx Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-18 12:53:36 -08:00
jz4740 ASoC: check for substream not channels_min in pcm engines 2012-01-07 11:18:05 -08:00
kirkwood Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-12 08:00:30 -08:00
mid-x86 ASoC: check for substream not channels_min in pcm engines 2012-01-07 11:18:05 -08:00
mxs ASoC: mxs: Fix mxs-saif timeout 2012-01-20 18:38:44 +00:00
nuc900 Merge branch 'master' into fixes 2012-01-13 15:00:22 +00:00
omap Merge branch 'for-3.3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into topic/asoc 2012-01-12 09:48:20 +01:00
pxa ASoC: pxa: Convert corgi to use snd_soc_register_card() 2012-01-02 13:08:40 +00:00
s6000 ASoC: s6000: Add .owner to struct snd_soc_card 2011-12-23 11:32:00 +00:00
samsung Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
sh Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
tegra ASoC: check for substream not channels_min in pcm engines 2012-01-07 11:18:05 -08:00
txx9 Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
Kconfig ASoC: Remove LZO cache type 2011-11-10 13:08:09 +00:00
Makefile ASoC: mxs: add asoc configuration files 2011-07-28 11:47:41 +01:00
soc-cache.c ASoC: Remove rbtree register cache 2011-12-13 00:20:28 +08:00
soc-core.c ASoC: core - Free platform DAPM context at platform removal. 2012-01-16 15:49:09 +00:00
soc-dapm.c ASoC: dapm - Fix check for codec context in dapm_power_widgets(). 2012-01-16 15:49:09 +00:00
soc-io.c sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
soc-jack.c ASoC: Remove ifdefs for GPIO_SYSFS 2011-12-21 00:12:28 +00:00
soc-pcm.c ASoC: soc-pcm: Allocate PCM operations dynamically to support multiple DAIs 2012-01-03 20:28:51 +00:00
soc-utils.c ASoC: Provide a more complete DMA driver stub 2011-12-06 10:05:07 +00:00