2010-11-25 03:28:06

by Axel Lin

[permalink] [raw]
Subject: [PATCH] ASoC: davinci-vcif - fix a memory leak

Signed-off-by: Axel Lin <[email protected]>
---
sound/soc/davinci/davinci-vcif.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
index fb4cc1e..9d2afcc 100644
--- a/sound/soc/davinci/davinci-vcif.c
+++ b/sound/soc/davinci/davinci-vcif.c
@@ -247,7 +247,10 @@ fail:

static int davinci_vcif_remove(struct platform_device *pdev)
{
+ struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev);
+
snd_soc_unregister_dai(&pdev->dev);
+ kfree(davinci_vcif_dev);

return 0;
}
--
1.7.2



2010-11-25 10:47:03

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH] ASoC: davinci-vcif - fix a memory leak

On Thu, 2010-11-25 at 11:33 +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <[email protected]>
> ---
> sound/soc/davinci/davinci-vcif.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c
> index fb4cc1e..9d2afcc 100644
> --- a/sound/soc/davinci/davinci-vcif.c
> +++ b/sound/soc/davinci/davinci-vcif.c
> @@ -247,7 +247,10 @@ fail:
>
> static int davinci_vcif_remove(struct platform_device *pdev)
> {
> + struct davinci_vcif_dev *davinci_vcif_dev = dev_get_drvdata(&pdev->dev);
> +
> snd_soc_unregister_dai(&pdev->dev);
> + kfree(davinci_vcif_dev);
>
> return 0;
> }

Acked-by: Liam Girdwood <[email protected]>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-11-25 11:13:01

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH] ASoC: davinci-vcif - fix a memory leak

On Thu, Nov 25, 2010 at 11:33:14AM +0800, Axel Lin wrote:
> Signed-off-by: Axel Lin <[email protected]>

Applied, thanks.