From be7ee27822975cee5dabb2cfd7f03e7fde38e3f4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 27 Jun 2006 13:07:04 +0200 Subject: [PATCH] [ALSA] Fix misuse of __list_add() in seq_ports.c seq_ports.c::snd_seq_delete_all_ports() uses __list_add() to replace the whole list entries. This results in BUG() with recent FC5 kernel due to a sanity check in __list_add(). The patch fixes this misue of __list_add() by using standard macros instead (although a bit more code is needed). Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- sound/core/seq/seq_ports.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 334579a9f268..d467b4f0ff2b 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c @@ -322,10 +322,8 @@ int snd_seq_delete_all_ports(struct snd_seq_client *client) mutex_lock(&client->ports_mutex); write_lock_irqsave(&client->ports_lock, flags); if (! list_empty(&client->ports_list_head)) { - __list_add(&deleted_list, - client->ports_list_head.prev, - client->ports_list_head.next); - INIT_LIST_HEAD(&client->ports_list_head); + list_add(&deleted_list, &client->ports_list_head); + list_del_init(&client->ports_list_head); } else { INIT_LIST_HEAD(&deleted_list); } -- 2.20.1