android_kernel_motorola_sm6225/sound
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
..
aoa Merge branch 'master' into for-next 2011-11-13 20:55:53 +01:00
arm Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-12 08:00:30 -08:00
atmel Merge branch 'next' of git://git.infradead.org/users/vkoul/slave-dma 2012-01-17 18:40:24 -08:00
core Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-17 10:48:13 -08:00
drivers ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
firewire Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux 2011-11-06 19:44:47 -08:00
i2c sound: Add module.h to the previously silent sound users 2011-10-31 19:31:21 -04:00
isa ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
mips ALSA: Convert mips directory to module_platform_driver 2011-11-24 13:03:02 +01:00
oss Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-12 08:00:30 -08:00
parisc
pci Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-17 10:48:13 -08:00
pcmcia ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
ppc Merge branch 'topic/misc' into for-linus 2012-01-12 09:59:14 +01:00
sh ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
soc ASoC: wm2000: Fix use-after-free - don't release_firmware() twice on error 2012-01-24 11:34:19 +00:00
sparc ALSA: module_param: make bool parameters really bool 2011-12-19 10:34:41 +01:00
spi ALSA: atmel - update author email for ABDAC, AC97C and AT73C213 2011-06-28 16:56:07 +02:00
synth sound: Add export.h for THIS_MODULE/EXPORT_SYMBOL where needed 2011-10-31 19:31:22 -04:00
usb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound 2012-01-12 08:00:30 -08:00
ac97_bus.c sound: Fixed line limit issue in sound/ac97_bus.c 2010-12-06 16:09:49 +01:00
Kconfig um: switch to use of drivers/Kconfig 2011-11-02 14:15:41 +01:00
last.c
Makefile ALSA: add LaCie FireWire Speakers/Griffin FireWave Surround driver 2011-03-15 08:42:22 +01:00
sound_core.c switch device_get_devnode() and ->devnode() to umode_t * 2012-01-03 22:54:55 -05:00
sound_firmware.c sound: read i_size with i_size_read() 2011-03-18 15:14:57 +01:00