mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: "Alexander E. Patrakov" <patrakov@gmail.com>
Cc: Clemens Ladisch <clemens@ladisch.de>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [alsa-devel] kmemleak findings about USB audio recording on	3.3.2
Date: Thu, 31 May 2012 10:34:19 +0200	[thread overview]
Message-ID: <s5hhauwwxys.wl%tiwai@suse.de> (raw)
In-Reply-To: <CAN_LGv3a=X2GSjanvJAPG_0H14PUbw+XZZ+yoo6QnXwxunRDFw@mail.gmail.com>

At Sun, 27 May 2012 17:18:38 +0600,
Alexander E. Patrakov wrote:
> 
> 2012/5/18 Clemens Ladisch <clemens@ladisch.de>:
> > Please try this patch.
> >
> > --8<---------------------------------------------------------------->8--
> > ALSA: usb-audio: fix rate_list memory leak
> >
> > The array of sample rates is reallocated every time when opening
> > the PCM device, but was freed only once when unplugging the device.
> >
> > Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com>
> > Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
> > ---
> >  sound/usb/pcm.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> >
> > --- a/sound/usb/pcm.c
> > +++ b/sound/usb/pcm.c
> > @@ -783,6 +783,9 @@ static int snd_usb_pcm_check_knot(struct snd_pcm_runtime *runtime,
> >        int count = 0, needs_knot = 0;
> >        int err;
> >
> > +       kfree(subs->rate_list.list);
> > +       subs->rate_list.list = NULL;
> > +
> >        list_for_each_entry(fp, &subs->fmt_list, list) {
> >                if (fp->rates & SNDRV_PCM_RATE_CONTINUOUS)
> >                        return 0;
> 
> I have applied this on top of 3.4.0. So far, the microphone works, and
> there are no leaks detected.

OK, I applied the patch to sound git tree now.


thanks,

Takashi

      reply	other threads:[~2012-05-31  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-22 16:37 Alexander E. Patrakov
2012-05-18 16:00 ` Clemens Ladisch
2012-05-27 11:18   ` Alexander E. Patrakov
2012-05-31  8:34     ` Takashi Iwai [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hhauwwxys.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patrakov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®