diff options
author | Axel Lin <axel.lin@gmail.com> | 2010-07-23 05:53:43 +0000 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-08-03 07:40:26 +0100 |
commit | fd3c8ac9cb653f7e3122bba9bc7beaad6062b7f4 (patch) | |
tree | 96bcb74e54147688758f0d0ad8690eadf763e022 /sound | |
parent | 992bee401c06872175056bc5567cb3ebab098cb5 (diff) | |
download | linux-3.10-fd3c8ac9cb653f7e3122bba9bc7beaad6062b7f4.tar.gz linux-3.10-fd3c8ac9cb653f7e3122bba9bc7beaad6062b7f4.tar.bz2 linux-3.10-fd3c8ac9cb653f7e3122bba9bc7beaad6062b7f4.zip |
ASoC: ad1836: fix a memory leak if another ad1836 is registered
ad1836 is allocated in ad1836_spi_probe() but is not freed if ad1836_register()
return -EINVAL (if another ad1836 is registered).
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/ad1836.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/soc/codecs/ad1836.c b/sound/soc/codecs/ad1836.c index 21753842322..a01006c8c60 100644 --- a/sound/soc/codecs/ad1836.c +++ b/sound/soc/codecs/ad1836.c @@ -272,6 +272,7 @@ static int ad1836_register(struct ad1836_priv *ad1836) if (ad1836_codec) { dev_err(codec->dev, "Another ad1836 is registered\n"); + kfree(ad1836); return -EINVAL; } |