Skip to content

Commit dd6c5cd

Browse files
author
Al Viro
committed
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 <[email protected]>
1 parent 0525290 commit dd6c5cd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/core/pcm_native.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1649,6 +1649,7 @@ static int snd_pcm_link(struct snd_pcm_substream *substream, int fd)
16491649
}
16501650
if (!snd_pcm_stream_linked(substream)) {
16511651
substream->group = group;
1652+
group = NULL;
16521653
spin_lock_init(&substream->group->lock);
16531654
INIT_LIST_HEAD(&substream->group->substreams);
16541655
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)
16631664
_nolock:
16641665
snd_card_unref(substream1->pcm->card);
16651666
fput_light(file, fput_needed);
1666-
if (res < 0)
1667-
kfree(group);
1667+
kfree(group);
16681668
return res;
16691669
}
16701670

0 commit comments

Comments
 (0)