diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-05 14:07:08 -0400 |
---|---|---|
committer | Luis Henriques <luis.henriques@canonical.com> | 2013-06-17 13:38:56 +0100 |
commit | 7beb3c6527397a7fb25468b25d0e31a0e5c289c6 (patch) | |
tree | 1adfeacb2a409645442351a5bdfd012d817f6e99 | |
parent | 5c09ba64a744a2c8d66c9f3ad42d1ac3f8428747 (diff) |
snd_pcm_link(): fix a leak...
commit dd6c5cd8fedddc9605209098e2fa4e82c7af22aa upstream.
in case when snd_pcm_stream_linked(substream) is true, we end up leaking
group.
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>
-rw-r--r-- | sound/core/pcm_native.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 7203c9a5a405..ffb9153e1113 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; } |