Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932303Ab2EaIe2 (ORCPT ); Thu, 31 May 2012 04:34:28 -0400 Received: from cantor2.suse.de ([195.135.220.15]:36025 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758090Ab2EaIeY (ORCPT ); Thu, 31 May 2012 04:34:24 -0400 Date: Thu, 31 May 2012 10:34:19 +0200 Message-ID: From: Takashi Iwai To: "Alexander E. Patrakov" Cc: Clemens Ladisch , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [alsa-devel] kmemleak findings about USB audio recording on 3.3.2 In-Reply-To: References: <1335112621.20322.8.camel@home> <4FB6722B.6050103@ladisch.de> User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 45 At Sun, 27 May 2012 17:18:38 +0600, Alexander E. Patrakov wrote: > > 2012/5/18 Clemens Ladisch : > > 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" > > Signed-off-by: Clemens Ladisch > > --- > >  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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/