]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] ISDN Eicon driver: fix idi cleanup deadlock
authorArmin Schindler <armin@melware.de>
Sun, 9 May 2004 03:28:53 +0000 (20:28 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sun, 9 May 2004 03:28:53 +0000 (20:28 -0700)
   On IDI module cleanup, the freed card must be removed from list.
   Use list_empty() instead of list_for_each() loop. Thanks Linus.

drivers/isdn/hardware/eicon/idifunc.c

index 7824cf95bd959dc484a1fc5935e754ce63848e61..f3427aad634bd0d984abbf37138b2662cdc65f59 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: idifunc.c,v 1.14 2004/03/21 18:13:43 armin Exp $
+/* $Id: idifunc.c,v 1.14.4.2 2004/05/09 16:42:20 armin Exp $
  *
  * Driver for Eicon DIVA Server ISDN cards.
  * User Mode IDI Interface 
@@ -137,14 +137,14 @@ static void um_remove_card(DESCRIPTOR * d)
 static void DIVA_EXIT_FUNCTION remove_all_idi_proc(void)
 {
        udiva_card *card;
-       struct list_head *tmp;
        diva_os_spin_lock_magic_t old_irql;
 
 rescan:
        diva_os_enter_spin_lock(&ll_lock, &old_irql, "remove all");
-       list_for_each(tmp, &cards) {
-               card = list_entry(tmp, udiva_card, list);
-       diva_os_leave_spin_lock(&ll_lock, &old_irql, "remove all");
+       if (!list_empty(&cards)) {
+               card = list_entry(cards.next, udiva_card, list);
+               list_del(&card->list);
+               diva_os_leave_spin_lock(&ll_lock, &old_irql, "remove all");
                diva_user_mode_idi_remove_adapter(card->Id);
                diva_os_free(0, card);
                goto rescan;