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
au1x
blackfin
codecs ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error 2012-01-24 11:34:19 +00:00
davinci
ep93xx
fsl
imx
jz4740
kirkwood
mid-x86
mxs ASoC: mxs: Fix mxs-saif timeout 2012-01-20 18:38:44 +00:00
nuc900
omap
pxa
s6000
samsung
sh
tegra
txx9
Kconfig
Makefile
soc-cache.c
soc-core.c
soc-dapm.c
soc-io.c
soc-jack.c
soc-pcm.c
soc-utils.c