Commit dd6c5cd8 authored by Al Viro's avatar Al Viro

snd_pcm_link(): fix a leak...

in case when snd_pcm_stream_linked(substream) is true, we end up leaking
group.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 05252901
...@@ -1649,6 +1649,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) ...@@ -1649,6 +1649,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
} }
if (!snd_pcm_stream_linked(substream)) { if (!snd_pcm_stream_linked(substream)) {
substream->group = group; substream->group = group;
group = NULL;
spin_lock_init(&substream->group->lock); spin_lock_init(&substream->group->lock);
INIT_LIST_HEAD(&substream->group->substreams); INIT_LIST_HEAD(&substream->group->substreams);
list_add_tail(&substream->link_list, &substream->group->substreams); list_add_tail(&substream->link_list, &substream->group->substreams);
...@@ -1663,7 +1664,6 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd) ...@@ -1663,7 +1664,6 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
_nolock: _nolock:
snd_card_unref(substream1->pcm->card); snd_card_unref(substream1->pcm->card);
fput_light(file, fput_needed); fput_light(file, fput_needed);
if (res < 0)
kfree(group); kfree(group);
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment