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-14 21:42:42 -0400 |
commit | dd6c5cd8fedddc9605209098e2fa4e82c7af22aa (patch) | |
tree | 652ebd37f734f7feea8aab5ba7ee10112a4c1df9 /sound | |
parent | 05252901199d886a68830befb135d1723730ca86 (diff) |
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>
Diffstat (limited to 'sound')
-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 ccfa383f1fda..f92818155958 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) | |||
1649 | } | 1649 | } |
1650 | if (!snd_pcm_stream_linked(substream)) { | 1650 | if (!snd_pcm_stream_linked(substream)) { |
1651 | substream->group = group; | 1651 | substream->group = group; |
1652 | group = NULL; | ||
1652 | spin_lock_init(&substream->group->lock); | 1653 | spin_lock_init(&substream->group->lock); |
1653 | INIT_LIST_HEAD(&substream->group->substreams); | 1654 | INIT_LIST_HEAD(&substream->group->substreams); |
1654 | list_add_tail(&substream->link_list, &substream->group->substreams); | 1655 | 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) | |||
1663 | _nolock: | 1664 | _nolock: |
1664 | snd_card_unref(substream1->pcm->card); | 1665 | snd_card_unref(substream1->pcm->card); |
1665 | fput_light(file, fput_needed); | 1666 | fput_light(file, fput_needed); |
1666 | if (res < 0) | 1667 | kfree(group); |
1667 | kfree(group); | ||
1668 | return res; | 1668 | return res; |
1669 | } | 1669 | } |
1670 | 1670 | ||