[3.5.y.z,extended,stable] Patch "snd_pcm_link(): fix a leak..." has been added to staging queue

Submitted by Luis Henriques on June 17, 2013, 2:46 p.m.


Message ID 1371480406-16771-1-git-send-email-luis.henriques@canonical.com
State New
Headers show

Commit Message

Luis Henriques June 17, 2013, 2:46 p.m.
This is a note to let you know that I have just added a patch titled

    snd_pcm_link(): fix a leak...

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:


If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see



From 7beb3c6527397a7fb25468b25d0e31a0e5c289c6 Mon Sep 17 00:00:00 2001
From: Al Viro <viro@zeniv.linux.org.uk>
Date: Wed, 5 Jun 2013 14:07:08 -0400
Subject: [PATCH] snd_pcm_link(): fix a leak...

commit dd6c5cd8fedddc9605209098e2fa4e82c7af22aa upstream.

in case when snd_pcm_stream_linked(substream) is true, we end up leaking

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Jonghwan Choi <jhbird.choi@samsung.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
 sound/core/pcm_native.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Patch hide | download patch | download mbox

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;
 		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)
-	if (res < 0)
-		kfree(group);
+	kfree(group);
 	return res;