Skip to content

Commit

Permalink
ALSA: seq: Fix memory leak at error path in snd_seq_create_port()
Browse files Browse the repository at this point in the history
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: [email protected]
Closes: https://lore.kernel.org/r/[email protected]
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jul 17, 2023
1 parent b2cb84d commit 057849c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sound/core/seq/seq_ports.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ int snd_seq_create_port(struct snd_seq_client *client, int port,
write_lock_irq(&client->ports_lock);
list_for_each_entry(p, &client->ports_list_head, list) {
if (p->addr.port == port) {
kfree(new_port);
num = -EBUSY;
goto unlock;
}
Expand Down

0 comments on commit 057849c

Please sign in to comment.