Skip to content

Commit

Permalink
[ALSA] Fix misuse of __list_add() in seq_ports.c
Browse files Browse the repository at this point in the history
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 <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jun 28, 2006
1 parent b2e1b0c commit be7ee27
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions sound/core/seq/seq_ports.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit be7ee27

Please sign in to comment.