Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760053Ab2FGEm2 (ORCPT ); Thu, 7 Jun 2012 00:42:28 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:63657 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932448Ab2FGESb (ORCPT ); Thu, 7 Jun 2012 00:18:31 -0400 Message-Id: <20120607040341.601087511@linuxfoundation.org> User-Agent: quilt/0.60-19.1 Date: Thu, 07 Jun 2012 13:04:12 +0900 From: Greg KH To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: torvalds@linux-foundation.org, akpm@linux-foundation.org, alan@lxorguk.ukuu.org.uk, "Alexander E. Patrakov" , Clemens Ladisch , Takashi Iwai Subject: [ 36/82] ALSA: usb-audio: fix rate_list memory leak In-Reply-To: <20120607041406.GA13233@kroah.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1191 Lines: 39 3.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Clemens Ladisch commit 5cd5d7c44990658df6ab49f6253c39617c53b03d upstream. 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 Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- sound/usb/pcm.c | 3 +++ 1 file changed, 3 insertions(+) --- a/sound/usb/pcm.c +++ b/sound/usb/pcm.c @@ -699,6 +699,9 @@ static int snd_usb_pcm_check_knot(struct 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; -- 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/