[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTim21rRtOWi6MEnh_wAMFimiPMV4YGnDbwo2XqGx@mail.gmail.com>
Date: Tue, 20 Jul 2010 18:31:43 +0800
From: Barry Song <21cnbao@...il.com>
To: Axel Lin <axel.lin@...il.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Liam Girdwood <lrg@...mlogic.co.uk>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>,
Barry Song <Barry.Song@...log.com>, Tejun Heo <tj@...nel.org>,
alsa-devel@...a-project.org
Subject: Re: [PATCH 1/12] ad1836: fix a memory leak if another ad1836 is
registered
On Thu, Jul 15, 2010 at 10:50 AM, Axel Lin <axel.lin@...il.com> wrote:
> 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@...il.com>
Acked-by: Barry Song <21cnbao@...il.com>
> ---
> 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 2175384..a01006c 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;
> }
>
> --
> 1.5.4.3
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@...r.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists