* [PATCH 2/2 RESEND] ASoC: Fix resource reclaim for osk5912
@ 2010-11-24 14:24 Axel Lin
2010-11-25 21:47 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2010-11-24 14:24 UTC (permalink / raw)
To: linux-kernel
Cc: Charulatha, Jarkko Nikula, Liam Girdwood, Mark Brown, linux-omap,
alsa-devel
In current implementation, there are resources leak in the error path.
This patch properly reclaims the allocated resources in the error path.
Also adds a missing clk_put in osk_soc_exit.
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
---
sound/soc/omap/osk5912.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index 18d053d..7e75e77 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -177,7 +177,8 @@ static int __init osk_soc_init(void)
tlv320aic23_mclk = clk_get(dev, "mclk");
if (IS_ERR(tlv320aic23_mclk)) {
printk(KERN_ERR "Could not get mclk clock\n");
- return -ENODEV;
+ err = PTR_ERR(tlv320aic23_mclk);
+ goto err2;
}
/*
@@ -188,7 +189,7 @@ static int __init osk_soc_init(void)
if (clk_set_rate(tlv320aic23_mclk, CODEC_CLOCK)) {
printk(KERN_ERR "Cannot set MCLK for AIC23 CODEC\n");
err = -ECANCELED;
- goto err1;
+ goto err3;
}
}
@@ -196,9 +197,12 @@ static int __init osk_soc_init(void)
(uint) clk_get_rate(tlv320aic23_mclk), CODEC_CLOCK);
return 0;
-err1:
+
+err3:
clk_put(tlv320aic23_mclk);
+err2:
platform_device_del(osk_snd_device);
+err1:
platform_device_put(osk_snd_device);
return err;
@@ -207,6 +211,7 @@ err1:
static void __exit osk_soc_exit(void)
{
+ clk_put(tlv320aic23_mclk);
platform_device_unregister(osk_snd_device);
}
--
1.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2 RESEND] ASoC: Fix resource reclaim for osk5912
2010-11-24 14:24 [PATCH 2/2 RESEND] ASoC: Fix resource reclaim for osk5912 Axel Lin
@ 2010-11-25 21:47 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-11-25 21:47 UTC (permalink / raw)
To: Axel Lin
Cc: linux-kernel, Charulatha, Jarkko Nikula, Liam Girdwood,
linux-omap, alsa-devel
On Wed, Nov 24, 2010 at 10:24:01PM +0800, Axel Lin wrote:
> In current implementation, there are resources leak in the error path.
> This patch properly reclaims the allocated resources in the error path.
>
> Also adds a missing clk_put in osk_soc_exit.
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-11-25 21:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-24 14:24 [PATCH 2/2 RESEND] ASoC: Fix resource reclaim for osk5912 Axel Lin
2010-11-25 21:47 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox