summaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-11-26 14:54:42 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-11-29 11:01:06 +0000
commitd482337eaba627348ffb8b7c0752d65e16667cd9 (patch)
tree8401fb0e0b6df8f8452b750fe8831be24bb3c695 /sound/soc/samsung
parent3790f205465f5c47a3629129af875c94f61f1fd3 (diff)
downloadop-kernel-dev-d482337eaba627348ffb8b7c0752d65e16667cd9.zip
op-kernel-dev-d482337eaba627348ffb8b7c0752d65e16667cd9.tar.gz
ASoC: Fix resource leak in smdk_spdif.c
Properly free allocated resources in smdk_init() error path. Add missing platform_device_unregister() in smdk_exit(). Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Jassi Brar <jassi.brar@samsung.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/samsung')
-rw-r--r--sound/soc/samsung/smdk_spdif.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/samsung/smdk_spdif.c b/sound/soc/samsung/smdk_spdif.c
index cd29da0..ca779ad 100644
--- a/sound/soc/samsung/smdk_spdif.c
+++ b/sound/soc/samsung/smdk_spdif.c
@@ -183,7 +183,7 @@ static int __init smdk_init(void)
ret = platform_device_add(smdk_snd_spdif_dit_device);
if (ret)
- goto err2;
+ goto err1;
smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
if (!smdk_snd_spdif_device) {
@@ -195,17 +195,21 @@ static int __init smdk_init(void)
ret = platform_device_add(smdk_snd_spdif_device);
if (ret)
- goto err1;
+ goto err3;
/* Set audio clock heirachy manually */
ret = set_audio_clock_heirachy(smdk_snd_spdif_device);
if (ret)
- goto err1;
+ goto err4;
return 0;
-err1:
+err4:
+ platform_device_del(smdk_snd_spdif_device);
+err3:
platform_device_put(smdk_snd_spdif_device);
err2:
+ platform_device_del(smdk_snd_spdif_dit_device);
+err1:
platform_device_put(smdk_snd_spdif_dit_device);
return ret;
}
@@ -213,6 +217,7 @@ err2:
static void __exit smdk_exit(void)
{
platform_device_unregister(smdk_snd_spdif_device);
+ platform_device_unregister(smdk_snd_spdif_dit_device);
}
module_init(smdk_init);
OpenPOWER on IntegriCloud