]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: ASoC: Fix double free and memory leak in many codec drivers
authorJean Delvare <khali@linux-fr.org>
Mon, 25 Aug 2008 10:49:20 +0000 (11:49 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 25 Aug 2008 11:49:52 +0000 (13:49 +0200)
commit67d8e2724b9ea5b929a2958e17c2ca6a60c6183c
tree0908f13da020b0e6e5d025caa60b1fed4c056abc
parentd75cfd296fc03e79f0778fba5258db6f30b33193
ALSA: ASoC: Fix double free and memory leak in many codec drivers

Many SoC audio codec drivers have improper freeing of memory in error
paths.

* codec is allocated in the platform device probe function, but is not
  freed there in case of error. Instead it is freed in the i2c device
  probe function's error path. However the success or failure of both
  functions is not linked, so this could result in a double free (if
  the platform device is successfully probed, the i2c device probing
  fails and then the platform driver is unregistered.)

* codec->private_data is allocated in many platform device probe
  functions but not freed in their error paths.

This patch hopefully solves all these problems.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/soc/codecs/ak4535.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/uda1380.c
sound/soc/codecs/wm8510.c
sound/soc/codecs/wm8731.c
sound/soc/codecs/wm8750.c
sound/soc/codecs/wm8753.c
sound/soc/codecs/wm8990.c