Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / drivers / isdn / icn / icn.c
index 20c13c1..6649f8b 100644 (file)
@@ -304,12 +304,12 @@ icn_pollbchan_send(int channel, icn_card * card)
        isdn_ctrl cmd;
 
        if (!(card->sndcount[channel] || card->xskb[channel] ||
-             skb_queue_len(&card->spqueue[channel])))
+             !skb_queue_empty(&card->spqueue[channel])))
                return;
        if (icn_trymaplock_channel(card, mch)) {
                while (sbfree && 
                       (card->sndcount[channel] ||
-                       skb_queue_len(&card->spqueue[channel]) ||
+                       !skb_queue_empty(&card->spqueue[channel]) ||
                        card->xskb[channel])) {
                        spin_lock_irqsave(&card->lock, flags);
                        if (card->xmit_lock[channel]) {
@@ -908,14 +908,13 @@ icn_loadproto(u_char __user * buffer, icn_card * card)
        uint left = ICN_CODE_STAGE2;
        uint cnt;
        int timer;
-       int ret;
        unsigned long flags;
 
 #ifdef BOOT_DEBUG
        printk(KERN_DEBUG "icn_loadproto called\n");
 #endif
-       if ((ret = verify_area(VERIFY_READ, buffer, ICN_CODE_STAGE2)))
-               return ret;
+       if (!access_ok(VERIFY_READ, buffer, ICN_CODE_STAGE2))
+               return -EFAULT;
        timer = 0;
        spin_lock_irqsave(&dev.devlock, flags);
        if (card->secondhalf) {
@@ -948,8 +947,7 @@ icn_loadproto(u_char __user * buffer, icn_card * card)
                                icn_maprelease_channel(card, 0);
                                return -EIO;
                        }
-                       set_current_state(TASK_INTERRUPTIBLE);
-                       schedule_timeout(10);
+                       schedule_timeout_interruptible(10);
                }
        }
        writeb(0x20, &sbuf_n);
@@ -1651,7 +1649,7 @@ static void __exit icn_exit(void)
 {
        isdn_ctrl cmd;
        icn_card *card = cards;
-       icn_card *last;
+       icn_card *last, *tmpcard;
        int i;
        unsigned long flags;
 
@@ -1671,8 +1669,9 @@ static void __exit icn_exit(void)
                        for (i = 0; i < ICN_BCH; i++)
                                icn_free_queue(card, i);
                }
-               card = card->next;
+               tmpcard = card->next;
                spin_unlock_irqrestore(&card->lock, flags);
+               card = tmpcard;
        }
        card = cards;
        cards = NULL;