diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-05 14:07:08 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-06-15 05:42:42 +0400 |
commit | dd6c5cd8fedddc9605209098e2fa4e82c7af22aa (patch) | |
tree | 652ebd37f734f7feea8aab5ba7ee10112a4c1df9 | |
parent | 05252901199d886a68830befb135d1723730ca86 (diff) | |
download | op-kernel-dev-dd6c5cd8fedddc9605209098e2fa4e82c7af22aa.zip op-kernel-dev-dd6c5cd8fedddc9605209098e2fa4e82c7af22aa.tar.gz |
snd_pcm_link(): fix a leak...
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>
-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 ccfa383..f928181 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -1649,6 +1649,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); @@ -1663,8 +1664,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) _nolock: snd_card_unref(substream1->pcm->card); fput_light(file, fput_needed); - if (res < 0) - kfree(group); + kfree(group); return res; } |