Skip to content

Commit 057849c

Browse files
committed
ALSA: seq: Fix memory leak at error path in snd_seq_create_port()
We forgot to release a newly allocated item at the error path in snd_seq_create_port(). This patch fixes it. Fixes: 7c3f0d3 ("ALSA: seq: Check the conflicting port at port creation") Reported-by: syzbot+cf8e7fa4eeec59b3d485@syzkaller.appspotmail.com Closes: https://lore.kernel.org/r/00000000000098ed3a0600965f89@google.com Link: https://lore.kernel.org/r/20230717062555.31592-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent b2cb84d commit 057849c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sound/core/seq/seq_ports.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ int snd_seq_create_port(struct snd_seq_client *client, int port,
149149
write_lock_irq(&client->ports_lock);
150150
list_for_each_entry(p, &client->ports_list_head, list) {
151151
if (p->addr.port == port) {
152+
kfree(new_port);
152153
num = -EBUSY;
153154
goto unlock;
154155
}

0 commit comments

Comments
 (0)