* [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove()
@ 2010-08-25 8:59 Axel Lin
2010-08-25 9:53 ` Liam Girdwood
2010-08-25 13:22 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Axel Lin @ 2010-08-25 8:59 UTC (permalink / raw)
To: linux-kernel; +Cc: Liam Girdwood, Mark Brown
The "priv" allocated in pxa_ssp_probe() should be kfreed in pxa_ssp_remove().
Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
This patch is against 2.6.36-rc2-git3.
sound/soc/pxa/pxa-ssp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
index a1fd23e..2a9cac7 100644
--- a/sound/soc/pxa/pxa-ssp.c
+++ b/sound/soc/pxa/pxa-ssp.c
@@ -760,6 +760,7 @@ static void pxa_ssp_remove(struct platform_device *pdev,
{
struct ssp_priv *priv = dai->private_data;
pxa_ssp_free(priv->ssp);
+ kfree(priv);
}
#define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
--
1.7.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove()
2010-08-25 8:59 [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove() Axel Lin
@ 2010-08-25 9:53 ` Liam Girdwood
2010-08-25 13:22 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Liam Girdwood @ 2010-08-25 9:53 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Mark Brown
On Wed, 2010-08-25 at 16:59 +0800, Axel Lin wrote:
> The "priv" allocated in pxa_ssp_probe() should be kfreed in pxa_ssp_remove().
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
> This patch is against 2.6.36-rc2-git3.
> sound/soc/pxa/pxa-ssp.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c
> index a1fd23e..2a9cac7 100644
> --- a/sound/soc/pxa/pxa-ssp.c
> +++ b/sound/soc/pxa/pxa-ssp.c
> @@ -760,6 +760,7 @@ static void pxa_ssp_remove(struct platform_device *pdev,
> {
> struct ssp_priv *priv = dai->private_data;
> pxa_ssp_free(priv->ssp);
> + kfree(priv);
> }
>
> #define PXA_SSP_RATES (SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 |\
Acked-by:Liam Girdwood <lrg@slimlogic.co.uk>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove()
2010-08-25 8:59 [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove() Axel Lin
2010-08-25 9:53 ` Liam Girdwood
@ 2010-08-25 13:22 ` Mark Brown
2010-08-26 6:10 ` Axel Lin
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-08-25 13:22 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood
On Wed, Aug 25, 2010 at 04:59:11PM +0800, Axel Lin wrote:
> The "priv" allocated in pxa_ssp_probe() should be kfreed in pxa_ssp_remove().
>
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
This doesn't apply against current ASoC. I fixed this up by hand since
the error was so trivial but in future could you please make sure you
generate your code against the latest version of ASoC? This will be in
-next at any given time, or for the individual tree you want the latest
for-2.6.nn branch of:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove()
2010-08-25 13:22 ` Mark Brown
@ 2010-08-26 6:10 ` Axel Lin
2010-08-26 8:47 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Axel Lin @ 2010-08-26 6:10 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-kernel, Liam Girdwood
2010/8/25 Mark Brown <broonie@opensource.wolfsonmicro.com>:
> On Wed, Aug 25, 2010 at 04:59:11PM +0800, Axel Lin wrote:
>> The "priv" allocated in pxa_ssp_probe() should be kfreed in pxa_ssp_remove().
>>
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> This doesn't apply against current ASoC. I fixed this up by hand since
> the error was so trivial but in future could you please make sure you
> generate your code against the latest version of ASoC? This will be in
> -next at any given time, or for the individual tree you want the latest
> for-2.6.nn branch of:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
>
Thanks, Mark.
I just thought this fix should be applied to 2.6.36.
And ASoC tree will have this fix after merge 2.6.36.
Regards,
Axel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove()
2010-08-26 6:10 ` Axel Lin
@ 2010-08-26 8:47 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2010-08-26 8:47 UTC (permalink / raw)
To: Axel Lin; +Cc: linux-kernel, Liam Girdwood
On Thu, Aug 26, 2010 at 02:10:06PM +0800, Axel Lin wrote:
> I just thought this fix should be applied to 2.6.36.
> And ASoC tree will have this fix after merge 2.6.36.
It's a memory leak on unload for a driver for a device integrated into
an embedded SoC - I'd be astonished if anyone managed to run into it in
production.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-26 8:47 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-25 8:59 [PATCH] ASoC: pxa-ssp: fix a memory leak in pxa_ssp_remove() Axel Lin
2010-08-25 9:53 ` Liam Girdwood
2010-08-25 13:22 ` Mark Brown
2010-08-26 6:10 ` Axel Lin
2010-08-26 8: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