==================================================================
Reported-by: syzbot+1a54a94bd32716796edd@syzkaller.appspotmail.com
Signed-off-by: Zhang Qiang <qiang.zhang@windriver.com>
---
sound/core/seq/seq_ports.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
@@ -533,8 +533,7 @@ static void delete_and_unsubscribe_port(struct snd_seq_client *client,
grp->exclusive = 0;
write_unlock_irq(&grp->list_lock);
- if (!empty)
- unsubscribe_port(client, port, grp, &subs->info, ack);
+ unsubscribe_port(client, port, grp, &subs->info, ack);
up_write(&grp->list_mutex);
}
@@ -599,6 +598,7 @@ int snd_seq_port_disconnect(struct snd_seq_client *connector,
list_for_each_entry(subs, &src->list_head, src_list) {
if (match_subs_info(info, &subs->info)) {
atomic_dec(&subs->ref_count); /* mark as not ready */
+ list_del_init(&subs->src_list);
err = 0;
break;
}