From patchwork Tue Jun 18 11:43:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Henriques X-Patchwork-Id: 252330 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 337142C016F for ; Tue, 18 Jun 2013 21:50:24 +1000 (EST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UouQT-00058i-R6; Tue, 18 Jun 2013 11:50:17 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1UouLu-0002az-K7 for kernel-team@lists.ubuntu.com; Tue, 18 Jun 2013 11:45:34 +0000 Received: from bl16-85-234.dsl.telepac.pt ([188.81.85.234] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1UouLu-0008VW-EE; Tue, 18 Jun 2013 11:45:34 +0000 From: Luis Henriques To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 93/93] snd_pcm_link(): fix a leak... Date: Tue, 18 Jun 2013 12:43:41 +0100 Message-Id: <1371555821-12820-94-git-send-email-luis.henriques@canonical.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371555821-12820-1-git-send-email-luis.henriques@canonical.com> References: <1371555821-12820-1-git-send-email-luis.henriques@canonical.com> X-Extended-Stable: 3.5 Cc: Jonghwan Choi , Al Viro X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com 3.5.7.15 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Al Viro commit dd6c5cd8fedddc9605209098e2fa4e82c7af22aa upstream. in case when snd_pcm_stream_linked(substream) is true, we end up leaking group. Signed-off-by: Al Viro Cc: Jonghwan Choi Signed-off-by: Luis Henriques --- sound/core/pcm_native.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 7203c9a..ffb9153 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1633,6 +1633,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) } if (!snd_pcm_stream_linked(substream)) { substream->group = group; + group = NULL; spin_lock_init(&substream->group->lock); INIT_LIST_HEAD(&substream->group->substreams); list_add_tail(&substream->link_list, &substream->group->substreams); @@ -1647,8 +1648,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) _nolock: snd_card_unref(substream1->pcm->card); fput(file); - if (res < 0) - kfree(group); + kfree(group); return res; }